ci(github): fix branch glob to actually match release branches#2401
ci(github): fix branch glob to actually match release branches#2401acelyc111 wants to merge 1 commit into
Conversation
The branch filter pattern 'v[0-9]+.*' uses GitHub Actions' glob syntax (not regex), where '+' is a literal character and '[0-9]' matches a single digit. As a result, this pattern never matches release branches like 'v2.5' or 'v2.5.1', so PRs targeting release branches skip these workflows entirely. For example, PR apache#2394 (targeting v2.5) only triggered the Go/Labeler workflows that don't have a branches filter, while Cpp CI and other language CIs were silently skipped. 'gh run list --workflow lint_and_test_cpp.yaml --branch v2.5' returns no runs at all, confirming the filter has never matched. Replace the broken pattern with 'v[0-9]*', which matches any branch starting with 'v' followed by a digit (v2.5, v2.5.1, v10.20, etc.). Apply the same fix to all 15 workflows that use this pattern.
Closing — original diagnosis was wrongAfter deeper investigation, the premise of this PR is incorrect: 1. 2. The reason 3. The actual root cause of
This is exactly what #2398 fixed on master (pinning every action to a SHA from the ASF allow-list, plus restructuring some workflows to use local composite actions). Correct fixI'll open a new PR targeting v2.5 that backports #2398-style SHA pinning of all third-party actions. Sorry for the noise. |
Summary
The branch filter
'v[0-9]+.*'used in 15 workflow files never matches any release branch, because GitHub Actions branch filters use glob syntax (not regex):+is a literal character, not a quantifier[0-9]matches exactly one digit, not "one or more"As a result, PRs targeting release branches like
v2.5silently skip every workflow that has this filter, while only those withoutbranches:filters (e.g., the Golang/Labeler ones) actually run.Evidence
PR #2394 targets
v2.5and modifiessrc/replica/duplication/**(C++ code):Golang Lint and Unit Test - admin-cli/pegic,Module Labeler(nobranchesfilter)Cpp CI,Lint and Test - admin-cli(cli proper),Lint and Test - go-client, etc.Confirmed historically:
Cpp CIhas never run on the v2.5 branch since the workflow was added.Fix
Replace
'v[0-9]+.*'with'v[0-9]*', which is valid GitHub Actions glob syntax and matchesv2.5,v2.5.1,v10.20, etc.Applied uniformly to all 15 affected workflows (mechanical sed replacement, one-line change per file).
Verification
yaml.safe_load)v2.5, etc.) so existing release-branch PRs start running full CINotes
This fix on
masterdoes not change behavior formaster-targeted PRs (they already match the first- masterline). The benefit materializes once the change is backported to release branches, after which release-branch PRs will trigger the full CI matrix as originally intended.