π·ββοΈ Accept main alongside master in workflow branch filters - #726
Merged
Conversation
We're about to rename the default branch from `master` to `main`, and a `branches:` filter that names a branch which no longer exists doesn't error: it just matches nothing. Since this repo has no required checks, that would leave CI silently dark rather than visibly broken, and nothing would stop an untested merge. The ordering is forced by how Actions resolves `pull_request` runs. The workflow file comes from the merge commit of head into base, and the `branches:` filter matches the *base* ref. So a PR that swapped `master` for `main` in one go would get no CI of its own while its base was still `master`, and neither would any of the open PRs the rename retargets, until each one was pushed again. Listing both names sidesteps that. `master` matches until the rename, `main` matches after it, and every retargeted PR picks the filter up from its new base without needing a rebase. The `master` entry becomes dead config once the rename lands, and is removed in a follow-up. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
We're about to rename the default branch from
mastertomain, and abranches:filter that names a branch which no longer exists doesn't error: it just matches nothing. Since this repo has no required checks, that would leave CI silently dark rather than visibly broken, and nothing would stop an untested merge.The ordering is forced by how Actions resolves
pull_requestruns. The workflow file comes from the merge commit of head into base, and thebranches:filter matches the base ref. So a PR that swappedmasterformainin one go would get no CI of its own while its base was stillmaster, and neither would any of the open PRs the rename retargets, until each one was pushed again.Listing both names sidesteps that.
mastermatches until the rename,mainmatches after it, and every retargeted PR picks the filter up from its new base without needing a rebase. Themasterentry becomes dead config once the rename lands, and is removed in a follow-up.π€ Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com