Currently, for PRs opened by external contributors, the various lint checks don't run (sometimes causing code that fails basic lint checks to be committed to main). From my current understanding (I find the docs around this confusing), we need to instead use the "pull_request" target. Refs: * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request * https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ Note that even then, we will need a manual step to approve running the lints for first time contributors. Which is fine, at least we'll see the option, unlike right now where they just can't be run until the code hits main.
30 lines
738 B
YAML
30 lines
738 B
YAML
name: "Lint (desktop)"
|
|
|
|
on:
|
|
# Run on every pull request (open or push to it) that changes desktop/
|
|
pull_request:
|
|
paths:
|
|
- "desktop/**"
|
|
- ".github/workflows/desktop-lint.yml"
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: desktop
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup node and enable yarn caching
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "yarn"
|
|
cache-dependency-path: "desktop/yarn.lock"
|
|
|
|
- run: yarn install
|
|
|
|
- run: yarn lint
|