Skip to content

Commit d30ca1c

Browse files
committed
test: keep the action test and record the verified token behavior
1 parent f0291a4 commit d30ca1c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎.github/actions/authorize-commenter/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ description: >-
1414
head or merge ref runs untrusted code with the privileges the gate was
1515
protecting.
1616
17-
The token must be able to read collaborator permissions, which the default
18-
`GITHUB_TOKEN` may not be. If it cannot, this action fails, so an
17+
The default `GITHUB_TOKEN` can read collaborator permissions with no more
18+
than `contents: read`. If a token ever cannot, this action fails, so an
1919
underpowered token denies everyone rather than quietly authorizing them.
2020
2121
inputs:

‎.github/workflows/test-authorize-commenter.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Test "Authorize Commenter" Action
22

3-
# Temporary. This exists to confirm that the default GITHUB_TOKEN can read
4-
# collaborator permissions. Remove it, or wire it into main.yml as a permanent
5-
# test, once that question is settled.
3+
# Unlike the other test-*.yml workflows, this one triggers directly rather than
4+
# through workflow_call, so that it actually runs on every pull request.
65

76
on: pull_request
87

@@ -17,7 +16,9 @@ jobs:
1716
- name: Checkout repository
1817
uses: actions/checkout@v6
1918

19+
# Skipped on forks, where the author has read access and would be refused.
2020
- name: A login with write access is authorized
21+
if: github.event.pull_request.head.repo.fork == false
2122
uses: ./.github/actions/authorize-commenter
2223
with:
2324
username: ${{ github.actor }}

0 commit comments

Comments
 (0)