Skip to content

Commit f534722

Browse files
jackfirthsamth
authored andcommitted
Fix resyntax permissions issue
The current Resyntax workflow runs on `pull_request`, which gives it a github token with **read-only** access when run on pull requests from forks. Using `pull_request_target` instead gives it a read-write token and allows the action to submit pull request reviews for pull requests from forks.
1 parent fa598b6 commit f534722

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/resyntax.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Resyntax
22

33
on:
4-
pull_request:
4+
# See https://github.community/t/github-actions-are-severely-limited-on-prs/18179 for
5+
# why this uses pull_request_target instead of pull_request
6+
pull_request_target:
57
types:
68
- opened
79
- edited
@@ -17,9 +19,13 @@ jobs:
1719

1820
steps:
1921
- uses: actions/checkout@v2
20-
# See https://github.com/actions/checkout/issues/118.
2122
with:
23+
# See https://github.com/actions/checkout/issues/118 for why the fetch depth needs to be zero
2224
fetch-depth: 0
25+
# See https://github.community/t/github-actions-are-severely-limited-on-prs/18179/17 for why
26+
# we need to specify the ref to checkout
27+
ref: ${{github.event.pull_request.head.ref}}
28+
repository: ${{github.event.pull_request.head.repo.full_name}}
2329
- uses: Bogdanp/[email protected]
2430
with:
2531
version: current

0 commit comments

Comments
 (0)