Skip to content

Commit 7460722

Browse files
authored
build: stop running PR title check on synchronize (#203)
## Problem The PR Title Check registers as failing on some PRs even though the title conforms — see #198. The check ends up with **two check-runs of the same name on the head commit**, one `SUCCESS` and one `CANCELLED`, and GitHub's status rollup treats the cancelled one as not-passing. ## Root cause When Dependabot rebases a PR it force-pushes a new commit **and** updates the PR body in the same instant. That fires two `pull_request_target` events nearly simultaneously: - `synchronize` — from the force-push - `edited` — from the body update Both resolve to the same concurrency group (`PR Title Check-<pr number>`), so `cancel-in-progress: true` cancels the first run when the second starts. Both runs had already created check-runs with identical names, leaving a dangling `CANCELLED` check-run alongside the successful one on the head commit. The concurrency config works as intended for superseding *older commits*; it only backfires when two events land on the *same* commit. ## Fix The check only validates the PR title and description, and neither changes on a push. So `synchronize` is both semantically unnecessary and the specific trigger racing against `edited`. Trigger only on `opened`, `edited`, and `reopened` — the events that actually change what's being validated. 🤖 Generated with AI
1 parent 702e045 commit 7460722

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/pr_title.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: PR Title Check
22

33
on:
4+
# Only the PR title and description are validated, and neither changes on a
5+
# push (synchronize). Including synchronize caused a race: a Dependabot rebase
6+
# force-pushes and edits the PR body at the same time, firing synchronize and
7+
# edited together. Both land in the same concurrency group, so one run is
8+
# cancelled, leaving a cancelled check-run on the head commit that fails the
9+
# status rollup.
410
pull_request_target:
5-
types: [opened, edited, synchronize, reopened]
11+
types: [opened, edited, reopened]
612

713
# Most recent PR change supersedes previous changes.
814
concurrency:

0 commit comments

Comments
 (0)