Skip to content

auto-update-pr: don't cancel CI on a PR that is already up to date - #48

Merged
goastler merged 1 commit into
mainfrom
auto-update/restart-only-when-behind
Nov 6, 2026
Merged

goastler merged 1 commit into
mainfrom
auto-update/restart-only-when-behind

Conversation

@goastler

@goastler goastler commented Nov 6, 2026

Copy link
Copy Markdown
Member

What changed

On a push to main, auto-update-pr now restarts the PR it is tracking only if GitHub says that PR is behind main.

Effect

Before: a second queued run could see the PR it had just updated still running CI, cancel every run, and call update-branch, which did nothing because the branch was already current. The PR was left with all its CI cancelled (seen on prosopo/captcha#3756, run https://github.com/prosopo/captcha/actions/runs/42301579934).
After: a PR that is already up to date keeps its running CI.

Tests

New unit test test_push_leaves_up_to_date_labelled_pr_running; all 18 tests in test_auto_update_pr.py pass.

A queued run after an update saw fresh CI on the just-updated PR, cancelled
it all and called update-branch as a no-op, leaving the PR with no CI.
@goastler
goastler enabled auto-merge (squash) November 6, 2026 22:14
@goastler
goastler merged commit 9183b69 into main Nov 6, 2026
83 checks passed
@goastler
goastler deleted the auto-update/restart-only-when-behind branch November 6, 2026 22:14
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