Skip to content

Skip the PR comment on runs that cannot post it - #3

Open
thc1006 wants to merge 1 commit into
ARRC-Rocket:mainfrom
thc1006:ci/skip-the-comment-fork-prs-cannot-post
Open

Skip the PR comment on runs that cannot post it#3
thc1006 wants to merge 1 commit into
ARRC-Rocket:mainfrom
thc1006:ci/skip-the-comment-fork-prs-cannot-post

Conversation

@thc1006

@thc1006 thc1006 commented Aug 8, 2026

Copy link
Copy Markdown
Member

The Comment on PR step fails on every pull request from a fork, which is what #2 ran into. This skips it there.

Step by step on that run:

Lint                success
Format check        success
Run script          success
Upload report.html  success
Comment on PR       failure     HttpError 403, resource not accessible by integration

This repository is public, so a pull_request run whose head is a fork gets a read-only GITHUB_TOKEN regardless of the permissions block, which can only narrow what the event already grants. Every earlier run on this workflow came from enh/setup-basics, a branch on the repository itself, which does get a write token. So the step had never been reached from a fork before.

Skipped rather than wrapped in continue-on-error, since a step that cannot succeed is better not attempted than tolerated. The report is unaffected: it is uploaded as the report artifact one step earlier, and internal pull requests still get the comment.

This pull request will show the same red until it lands, for the same reason.

The comment step fails on every pull request from a fork, and only those:

  Lint                success
  Format check        success
  Run script          success
  Upload report.html  success
  Comment on PR       failure   HttpError 403, resource not accessible

This repository is public, so a `pull_request` run whose head is a fork gets a
read-only GITHUB_TOKEN. `permissions: pull-requests: write` cannot raise that,
only narrow what the event already grants. Every earlier run came from a branch
on the repository itself, which does get a write token, so the step had not been
reached from a fork until ARRC-Rocket#2.

Skipped rather than tolerated with continue-on-error: a step that cannot succeed
is better not attempted. The report is unaffected either way, since it is
uploaded as the `report` artifact one step earlier.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant