Skip to content

CI: use the bfstop branch of the same name only if it is ahead of main - #23

Merged
codeling merged 1 commit into
mainfrom
ci-ignore-merged-branches
Oct 25, 2026
Merged

codeling merged 1 commit into
mainfrom
ci-ignore-merged-branches

Conversation

@codeling

Copy link
Copy Markdown
Owner

Problem

The integration jobs check out the plugin (codeling/bfstop) at the branch with the name of the PR branch if one exists, else main. A branch that was merged and not deleted is a stale copy of an old main, and the next PR with that name is tested against it. In codeling/bfstop#241 this made the jobs use a stale component. This repository's workflow has the mirror image of that step and the same flaw.

Change

The "Determine bfstop branch" step uses the same-named plugin branch only if it has commits bfstop's main doesn't (gh api repos/codeling/bfstop/compare/main...$branch --jq .ahead_by > 0). A merged branch falls back to main, deleted or not. Branch names are checked against ^[A-Za-z0-9._/-]+$ first; an API failure for an existing branch fails the step.

Same change as codeling/bfstop (separate PR there, with the test table; the script was tested there against a local repository with a fake gh, and the extracted step of this file passes bash -n). The jobs of this PR are the first real run: bfstop has a branch of the same name that is ahead of its main, so they should log Using bfstop ci-ignore-merged-branches.


Generated by Claude Code

…ahead of main

The integration jobs check out the other repository (com_bfstop / bfstop)
at the branch with the name of the PR branch if one exists, else main. A
branch which was merged and not deleted still exists, but is a stale copy of
an old main: the next PR with that name was tested against it (bfstop#241
against com_bfstop's merged pin-actions branch, which lacked #21).

Now the branch is used only if it has commits main hasn't (GitHub compare
API); a failing API call fails the step instead of silently using main.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhhhdjhErC9ZiaS4HyRjsh
@codeling
codeling merged commit 9755fe6 into main Oct 25, 2026
7 checks passed
@codeling
codeling deleted the ci-ignore-merged-branches branch October 25, 2026 20:57
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