Skip to content

fix(ci): stop pull_request and pull_request_target PR Automation runs cancelling each other - #366

Merged
jdfalk merged 1 commit into
mainfrom
ci/pr-automation-per-event-concurrency
Oct 5, 2026
Merged

jdfalk merged 1 commit into
mainfrom
ci/pr-automation-per-event-concurrency

Conversation

@jdfalk

@jdfalk jdfalk commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

pr-automation.yml triggers on both pull_request and pull_request_target, and both runs land in one concurrency group (PR Automation-<number>, cancel-in-progress: true). Every PR event starts both runs at the same instant; whichever is queued second cancels the other. The cancelled run's jobs show as red checks.

Evidence:

So this breaks every PR in the repo, independent of what the PR changes.

Fix

Add github.event_name to the group. Same-event supersession (a newer synchronize replacing an older one) still cancels, which is intended; the two triggers no longer cancel each other. cancel-in-progress: false would not fix it, since a newer pending run still replaces an older pending one.

This PR proves itself: its pull_request run uses the new group from the merge ref, its pull_request_target run uses main's old group, so they no longer collide.

Noted, not fixed here

The pull_request_target run's Code Quality Check does a plain actions/checkout with no ref, so on that event it checks out the base branch and lints main, not the PR. Its "pass" says nothing about the PR. Out of scope for this fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_017MtQ5LP2n3t3bs7AhptkKJ

… cancelling each other

Both triggers fire on every PR event into one concurrency group, so the
second run cancelled the first and its jobs showed as red cancelled checks
on every PR. Key the group on event_name too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MtQ5LP2n3t3bs7AhptkKJ
@github-actions github-actions Bot added size/S github-actions GitHub Actions related work automation Automation scripts and tools type:documentation Improvements or additions to documentation module:config Configuration management workflow:automation Automation and tooling workflow:github-actions GitHub Actions workflows labels Oct 5, 2026
@jdfalk
jdfalk merged commit 64d4295 into main Oct 5, 2026
42 checks passed
@jdfalk
jdfalk deleted the ci/pr-automation-per-event-concurrency branch October 5, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation Automation scripts and tools github-actions GitHub Actions related work module:config Configuration management size/S type:documentation Improvements or additions to documentation workflow:automation Automation and tooling workflow:github-actions GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant