Skip to content

ci: run PR Checks only for open PRs and for edits that change what they check - #181

Merged
mcoliver merged 1 commit into
mainfrom
ci/pr-checks-open-only
Oct 26, 2026
Merged

mcoliver merged 1 commit into
mainfrom
ci/pr-checks-open-only

Conversation

@mcoliver

Copy link
Copy Markdown
Collaborator

Fixes the Invalid revision range <base>..<head> commitlint failures, and stops description edits from re-running and cancelling PR checks.

Cause:

  • PR Checks runs on pull_request: edited. Editing the description of a merged PR, such as the footer clean-up across ~60 old PRs today, started PR Checks on each one.
  • Their head branches are deleted, so the fetch-depth: 0 checkout doesn't contain the head SHA, and commitlint --from base --to head fails. That's the 33 failed runs at 19:57 today.
  • On open PRs, a description edit re-ran all five jobs. Because they share concurrency: pr-<n> with cancel-in-progress, it also cancelled the code checks already running.

Change:

  • Every job requires pull_request.state == 'open'.
  • On edited:
    • The title check runs only if the title or base changed.
    • Commitlint, pre-commit, smoke build and Typst run only if the base changed.
  • Edit events get their own concurrency group (pr-<n>-edit), so they never cancel pr-<n>-code.

A skipped job reports as successful for required checks, so description edits no longer block or re-run anything.

Test: this PR's own run covers opened. After merge, editing this PR's description should show every job as skipped.

…ey check

PR Checks ran on every "edited" event. Editing a description re-ran all
five jobs and, through the shared concurrency group, cancelled the PR's
in-progress code checks. Editing a merged PR failed commitlint with
"Invalid revision range", because the deleted head branch isn't in the
checkout.

- Every job requires an open PR.
- On "edited", the title check runs only if the title or base changed, and
  the code checks only if the base changed.
- Edits use their own concurrency group, so they never cancel code checks.

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
@mcoliver
mcoliver force-pushed the ci/pr-checks-open-only branch from 1bd7bb3 to 82aded0 Compare October 26, 2026 20:14
@mcoliver
mcoliver merged commit 82aded0 into main Oct 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant