Skip to content

Autorelease: also grant pull-requests: write - #4

Merged
bacluc-agent merged 1 commit into
masterfrom
fix-autorelease-fork-pr-permissions
Nov 4, 2026
Merged

bacluc-agent merged 1 commit into
masterfrom
fix-autorelease-fork-pr-permissions

Conversation

@bacluc-agent

Copy link
Copy Markdown
Owner

Follow-up to #2, found while smoke-testing it on this fork.

projectsyn/pr-label-tag-action posts the release comment with issues.createComment/issues.updateComment. For a pull request conversation GitHub now authorizes the resource instead of the route, so an Issues: write token is rejected with 403 Resource not accessible by integration even though the response advertises x-accepted-github-permissions: issues=write; pull_requests=write — see run 41834795755, where the job logged Issues: write and still failed.

Requesting pull-requests: write instead of issues: write covers the comment (list/create/update) without granting the Issues tracker. The force-push amends the branch commit so the PR that goes upstream stays a single logical commit.

The Autorelease workflow failed on projectsyn#6
(run 41829920010) with:

  HttpError: Resource not accessible by integration
  POST /repos/projectsyn/issues/6/comments -> 403

Root cause: the job runs on `pull_request`. That PR was opened from the
bacluc-agent fork, and GitHub always hands such runs a read-only
GITHUB_TOKEN with no secrets ("GITHUB_TOKEN Permissions ... Issues: read"
and "Secret source: None" in the run log). The permissions key cannot lift
that restriction for fork runs, so every API write done by
projectsyn/pr-label-tag-action fails: the PR comment (issues), the release
tag (contents) and the "Release" workflow dispatch (actions).

PRs on branches inside the repository (for example the Renovate ones, or
component-solution-backup#1 which released v0.1.0) are unaffected, which is
why the same workflow file works in the other component repositories.

Switch the trigger to `pull_request_target`, which runs the base branch's
workflow with a write token even for public forks, and declare the three
permissions the action needs so the job no longer depends on the
repository's default workflow permissions. The job only reads the PR
metadata from the event payload and never checks out or executes code from
the PR, which is what makes pull_request_target safe here.

Consequence: runs for PRs from contributors without write access now need a
maintainer to approve them, as they carry a write token.
@bacluc-agent
bacluc-agent force-pushed the fix-autorelease-fork-pr-permissions branch from 9aa7ae1 to 085e591 Compare November 4, 2026 13:10
@bacluc-agent
bacluc-agent merged commit 6c4a35c into master Nov 4, 2026
13 checks passed
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.

2 participants