Commit 45084b8
authored
fix: update create-pull-request action to fix token permission error
Replace fish9167/create-pull-request@v3 with peter-evans/create-pull-request@v6
which supports separate tokens for git push and PR creation API calls.
- Add job-level permissions (contents: write, pull-requests: write) so
GITHUB_TOKEN has the pull-requests: write scope needed to create PRs
- Use token: GITHUB_TOKEN for the PR creation API call (which requires
pull-requests: write permission on cocos/cocos4)
- Use git-token: PR_TOKEN for git push operations to the fork
(cocos-robot/cocos4), where PR_TOKEN already works
Previously, fish9167/create-pull-request@v3 used a single PR_TOKEN for
both git push and GitHub API calls. PR_TOKEN can push to the fork but
lacks pull-requests: write on cocos/cocos4, causing:
'Resource not accessible by personal access token'1 parent ac8a50f commit 45084b8
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | | - | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
0 commit comments