Skip to content

fix: run version-suggestion as pull_request_target so fork PRs get a writable token - #116

Merged
aesslinger merged 1 commit into
mainfrom
fix/115-version-suggestion-fork-token
Sep 22, 2026
Merged

aesslinger merged 1 commit into
mainfrom
fix/115-version-suggestion-fork-token

Conversation

@aesslinger

Copy link
Copy Markdown
Collaborator

Summary

  • Splits the version-suggestion job out of ci.yml into its own workflow, .github/workflows/version-suggestion.yml, triggered on pull_request_target instead of pull_request.
  • pull_request_target runs with the base repo's token permissions even for fork-originated PRs, fixing the 403 when posting the version-suggestion comment.
  • The job never checks out or executes PR content — it only reads github.event.pull_request.title/body/labels from the event payload — so this is safe, per option 1 in the issue.
  • Removed labeled/unlabeled from ci.yml's pull_request trigger types since those were only needed for this job, which now has its own trigger types in the new file. Avoids redundant reruns of unrelated CI jobs (test, clippy, markdownlint, etc.) on label changes.

Fixes #115.

Test plan

  • actionlint passes on both ci.yml and version-suggestion.yml (pre-existing shellcheck style warnings in the copied script body confirmed present on main before this change too)
  • markdownlint clean (no .md changes)
  • Confirm on a real fork PR that Version suggestion now posts/updates a comment instead of 403ing

@aesslinger aesslinger added the prerelease:rc Version suggestion targets a release candidate label Sep 22, 2026
@aesslinger aesslinger self-assigned this Sep 22, 2026
@aesslinger
aesslinger merged commit f123cfe into main Sep 22, 2026
6 checks passed
@aesslinger
aesslinger deleted the fix/115-version-suggestion-fork-token branch September 22, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease:rc Version suggestion targets a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Version suggestion job fails on fork PRs (403 posting comment)

1 participant