Commit 9dfaed3
committed
fix: make php-cs-fixer action work with fork PRs
The checkout step used `ref: ${{ github.head_ref }}` which tries to
fetch the PR head branch from the base repository. For PRs from forks,
this branch doesn't exist in the base repo, causing the git fetch to
fail.
Additionally, the auto-commit step cannot push to fork branches using
the base repo's GITHUB_TOKEN.
Fix by using the default checkout (which fetches the merge commit for
pull_request events, working for both fork and same-repo PRs) and
switching from `fix` to `check --diff` mode. This reports formatting
issues without trying to auto-commit, which is the correct behavior
for an open-source project accepting external contributions.
https://claude.ai/code/session_01TRNQg795oQmXbu8pXNgYCT1 parent 7c59b0f commit 9dfaed3
1 file changed
+1
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 11 | | |
18 | 12 | | |
19 | 13 | | |
| |||
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 32 | + | |
0 commit comments