ci(merge-queue): only run queue job when the queue label is added - #717
Conversation
The Merge Queue workflow triggers on pull_request: types: [labeled], so it fired the merge-queue action on every label. On Dependabot PRs GitHub withholds secrets.MERGE_QUEUE_TOKEN from the run, so the action failed with "Input required and not supplied: token" the moment Dependabot's auto-applied `dependencies`/`go` labels landed (e.g. #716). Guard the job with an `if` so the action only engages when the added label is `queue` (or on manual dispatch). Non-queue label events skip the job cleanly instead of failing, and no secret is exposed to Dependabot-authored runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKpGw8pbTZHUJsyoFQBs4o
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the merge-queue GitHub Actions workflow to avoid running the merge-queue job on unrelated pull_request:labeled events (notably Dependabot’s auto-applied labels), preventing noisy failures when repository secrets are unavailable.
Changes:
- Add a job-level
if:guard so thequeuejob runs only forworkflow_dispatchor when the added label is exactlyqueue. - Document why the guard is needed (Dependabot-labeled runs do not receive
MERGE_QUEUE_TOKEN).
…sure Secrets are already withheld from Dependabot-authored runs, so the guard prevents a noisy failure on the absent token — it does not change token exposure. Reword the comment accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKpGw8pbTZHUJsyoFQBs4o
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
|
✅ Merge Queue — merged This PR landed on Next: Done — nothing more to do here. |
What
Guard the
queuejob in.github/workflows/merge-queue.ymlso the merge-queue action only engages when the label that triggered the run isqueue, or on manualworkflow_dispatch:Why
The workflow triggers on
pull_request: types: [labeled]— i.e. on any label being added — and the job unconditionally ranjeduden/merge-queue-action, which requirestoken: ${{ secrets.MERGE_QUEUE_TOKEN }}.On Dependabot PRs, GitHub withholds repository secrets from the run, so the token resolved to empty and the action failed immediately with:
This surfaced on #716 (bump
golang.org/x/tools): thequeuecheck went red the moment Dependabot's auto-applieddependencies/golabels landed, even though every other check was green.Effect
queuelabel events (Dependabot'sdependencies/go, or any stray human label) skip the job cleanly — a skipped check, not a red failure.queuelabel, or on manual dispatch.Note:
queueis not a required status check (the workflow never runs on an unlabeled PR), so the previous red X was non-blocking but noisy. This removes the noise and stops the action from firing on unrelated labels.🤖 Generated with Claude Code
Generated by Claude Code