Repository navigation
CI: use the bfstop branch of the same name only if it is ahead of main - #23
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 oldmain, 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
maindoesn't (gh api repos/codeling/bfstop/compare/main...$branch --jq .ahead_by> 0). A merged branch falls back tomain, 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 passesbash -n). The jobs of this PR are the first real run: bfstop has a branch of the same name that is ahead of itsmain, so they should logUsing bfstop ci-ignore-merged-branches.Generated by Claude Code