Skip to content

Commit 139e819

Browse files
dconlanclaude
andcommitted
Fix fork-PR false failures in security-scan
- continue-on-error on the SARIF upload step: GITHUB_TOKEN is forced read-only on pull_request runs triggered from forks regardless of the security-events: write permission declared in this workflow, so the upload always failed on external contributions (this repo has them - see PR #5). That failure was indistinguishable from a real Psalm finding in the job's status. The final step already gates correctly on steps.psalm.outcome alone, so this doesn't lose any signal. - Drop 'develop' from the push trigger - this repo no longer has a permanent develop branch. Found by /code-review on PR #6. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7b922e5 commit 139e819

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/security-scan.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: security-scan
33
on:
44
pull_request:
55
push:
6-
branches: [main, develop]
6+
branches: [main]
77

88
permissions:
99
contents: read
@@ -29,10 +29,17 @@ jobs:
2929
run: vendor/bin/psalm --taint-analysis --no-progress --report=psalm-results.sarif
3030
continue-on-error: true
3131

32+
# continue-on-error too: GITHUB_TOKEN is forced read-only on pull_request
33+
# runs triggered from forks, regardless of the security-events: write
34+
# permission declared above, so this step fails on every fork PR
35+
# (this repo has external contributors - see PR #5) for a reason
36+
# unrelated to Psalm's actual findings. Without this, that failure
37+
# would be indistinguishable from a real security finding.
3238
- name: Upload results to code scanning
3339
uses: github/codeql-action/upload-sarif@v3
3440
with:
3541
sarif_file: psalm-results.sarif
42+
continue-on-error: true
3643

3744
- name: Fail the job if Psalm found issues
3845
if: steps.psalm.outcome == 'failure'

0 commit comments

Comments
 (0)