Fix CI not running on pull requests targeting main#85
Open
RagingKore wants to merge 1 commit intoTylerBrinks:mainfrom
Open
Fix CI not running on pull requests targeting main#85RagingKore wants to merge 1 commit intoTylerBrinks:mainfrom
RagingKore wants to merge 1 commit intoTylerBrinks:mainfrom
Conversation
`pull_request.branches` in ci.yml filtered on [feature/**, bugfix/**], which per GitHub Actions semantics matches the PR's base branch, not its source. Contributor PRs target main, so the workflow never fired and the test suite effectively didn't run on any PR. Point the filter at main so the workflow activates. The feature/bugfix naming intent is preserved by a new validate-pr-branch-name job that runs only on pull_request events and checks github.head_ref — the source branch, which is what the original filter was trying to reach. continuous-integration gains an explicit `always() && (success || skipped)` guard so it runs both when the validation passes (PR path) and when it is skipped (push and workflow_dispatch paths, where the validation job doesn't run). push: and workflow_dispatch: triggers are unchanged.
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.
The
pull_requesttrigger in.github/workflows/ci.ymlfilters onbranches: [feature/**, bugfix/**]. That filter matches the base branch of the PR, not the source — so since contributor PRs targetmain, the workflow never fires. The test suite hasn't run on a PR in this repo.Quick audit: PRs #62, #39, #38 have zero checks; #79 and #61 only have CodeQL (that's a separate workflow). No
CIcheck anywhere.Hit this after opening #84 and waiting for CI that never showed up.
The fix
pull_request: branches: - - feature/** - - bugfix/** + - mainThat alone gets CI running on PRs, but it also drops the
feature//bugfix/naming intent. Which seems deliberate, so I'd rather preserve it properly.Preserving the naming intent
pull_request.branchescan't express "source branch must start with X" — the filter only sees the base branch. Source-branch checks go in a job that readsgithub.head_ref:The validate job only runs on
pull_requestevents, so direct pushes tomain/feature/**/bugfix/**are untouched. Thealways() && (success || skipped)guard oncontinuous-integrationis the important bit — it lets CI run both when validation passes (PR case) and when validation was skipped (push / dispatch case). Without it, GitHub's default "cascade skips downstream" would kill CI on pushes, which we don't want.A PR from a non-conforming branch lands a red ❌ on
validate-pr-branch-namewith an actionable error; CI stays skipped until the contributor renames.push:andworkflow_dispatch:left alone.Making it binding
Right now the check is advisory — someone could still merge a PR with a red X. To block merges, add a branch protection rule on
mainrequiringvalidate-pr-branch-name. Settings change, not a workflow change, so outside this PR.