Skip to content

fix(ci): don't fail backport job when fork comment is blocked - #16241

Merged
gr2m merged 1 commit into
mainfrom
fix/backport-fork-comment-nonfatal
Jun 17, 2026
Merged

fix(ci): don't fail backport job when fork comment is blocked#16241
gr2m merged 1 commit into
mainfrom
fix/backport-fork-comment-nonfatal

Conversation

@gr2m

@gr2m gr2m commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Background

Adding the backport label to a merged fork PR fires the labeled event. For pull_request events originating from a fork, GitHub forces GITHUB_TOKEN to read-only regardless of the job's declared pull-requests: write. The fork-guidance gh pr comment then fails with GraphQL: Resource not accessible by integration (addComment), and under set -euo pipefail the step aborts before the intended skip (exit 0) — failing the whole job.

Example failure: https://github.com/vercel/ai/actions/runs/27725203720/job/82019805216 (firing on #15855).

Summary

Make the fork-guidance comment best-effort (|| echo ::warning::…) so the job still exits cleanly via skip. The actual backport path (workflow_dispatch) is unaffected.

Manual Verification

The change is shell-only. The failing run above hit the gh pr comment line and aborted; with || echo, the script proceeds to skip and exits 0.

Checklist

  • All commits are signed
  • Tests have been added / updated
  • Documentation has been added / updated
  • A patch changeset for relevant packages has been added
  • I have reviewed this pull request (self-review)

Labeling a merged fork PR with `backport` fires the labeled event, whose
GITHUB_TOKEN is read-only for fork-originated pull_request events. The
fork-guidance `gh pr comment` then errors and, under `set -e`, aborts the
job before the intended skip. Make the comment best-effort.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gr2m gr2m added the maintenance CI, internal documentation, automations, etc label Jun 17, 2026
@gr2m
gr2m merged commit 53394b4 into main Jun 17, 2026
50 checks passed
@gr2m
gr2m deleted the fix/backport-fork-comment-nonfatal branch June 17, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI, internal documentation, automations, etc task-merge-tracking-no-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants