diff --git a/.github/workflows/lint-plugins.yml b/.github/workflows/lint-plugins.yml index 2d37a2c5c..8e3f3222c 100644 --- a/.github/workflows/lint-plugins.yml +++ b/.github/workflows/lint-plugins.yml @@ -11,14 +11,13 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: write steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run skillsaw - uses: stbenjam/skillsaw@d475638873e09327262ae82f5657d390a91a3c8a # v0 + uses: stbenjam/skillsaw@eee9ebea0f33517bfb3c4d0413471c5165becc7e # v0 with: strict: true verbose: true diff --git a/.github/workflows/lint-review.yml b/.github/workflows/lint-review.yml new file mode 100644 index 000000000..05170add9 --- /dev/null +++ b/.github/workflows/lint-review.yml @@ -0,0 +1,25 @@ +# Separate workflow for posting lint review comments on PRs. +# The lint workflow runs with a read-only token (safe for fork PRs that +# execute custom linter rules via subprocess). This workflow triggers +# after it completes, downloads the report artifact, and posts comments +# with a write-capable token — without ever checking out untrusted code. +name: Lint Review + +on: + workflow_run: + workflows: ["Lint Plugins"] + types: [completed] + +jobs: + review: + if: github.event.workflow_run.event == 'pull_request' + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Post review comments + uses: stbenjam/skillsaw/review@eee9ebea0f33517bfb3c4d0413471c5165becc7e # v0