Uh oh!
There was an error while loading. Please reload this page.
build(ci): align branch-name validator runtime and harden gitleaks checkout - #2502
build(ci): align branch-name validator runtime and harden gitleaks checkout#2502ashleyshaw with Copilot wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, targeted, and reduce CI flakiness without altering validation outcomes or expanding workflow permissions.
Pull request overview
This PR removes CI-only failure modes by aligning the branch-name validator’s exported runtime symbol with its debug/logging usage, and by hardening the gitleaks reusable workflow checkout configuration to avoid unintended submodule/gitlink initialisation.
Changes:
- Added and exported
BRANCH_PATTERNinvalidate-branch-name.cjsas an alias for the active standard branch regex. - Set
submodules: falseon theactions/checkoutstep in the gitleaks reusable workflow to prevent submodule handling during scans.
File summaries
| File | Description |
|---|---|
scripts/validation/validate-branch-name.cjs | Defines/exports BRANCH_PATTERN to prevent runtime ReferenceError paths and keep consumers stable. |
.github/workflows/gitleaks-reusable.yml | Disables submodule checkout to avoid gitleaks failures caused by fixture-like gitlink/submodule behaviour. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const BRANCH_PATTERN_STANDARD = new RegExp( | ||
| `^(${ALLOWED_TYPES.filter(t => t !== 'release').join('|')})/([a-z0-9]+(?:-[a-z0-9]+)*)-([a-z0-9]+(?:-[a-z0-9]+)*)$` | ||
| ); | ||
| const BRANCH_PATTERN = BRANCH_PATTERN_STANDARD; |
There was a problem hiding this comment.
Fixed in the latest commit. printPattern() now documents the standard and release patterns separately — it shows BRANCH_PATTERN_STANDARD (non-release types), then the two release-specific patterns (BRANCH_PATTERN_RELEASE_SEMVER and BRANCH_PATTERN_RELEASE_STANDARD) with their accepted formats. The DEBUG_VALIDATION logging has also been updated to log all three pattern constants and their individual match results, so it's no longer misleading for release branches.
🔍 Reviewer Summary for PR #2502CI Status: ❌ Recommendations
|
1 similar comment
🔍 Reviewer Summary for PR #2502CI Status: ❌ Recommendations
|
|
🚫 This PR description is missing required template content. Missing required section(s): Linked issues, Global DoD checklist Please update the PR body using one of the repository PR templates:
Empty placeholders, unchecked checklist boxes, and stub issue references do not count. |
…IDATION Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
Build/CI Pull Request
CI was failing on production-ready changes due to validation/runtime mismatch and checkout behaviour, not feature correctness. This update removes two failure modes that were causing branch-name and gitleaks checks to fail inconsistently.
Linked issues
Build/CI change
BRANCH_PATTERNinscripts/validation/validate-branch-name.cjsas an alias of the active standard regex.BRANCH_PATTERNso existing consumers/tests relying on that symbol remain stable.submodules: falsein.github/workflows/gitleaks-reusable.ymlcheckout step to prevent submodule/gitlink initialisation in fixture-like paths.Baseline & Target
Rollback
/home/runner/work/.github/.github/scripts/validation/validate-branch-name.cjs/home/runner/work/.github/.github/.github/workflows/gitleaks-reusable.ymlNotes
Changelog
Added
Changed
BRANCH_PATTERN) to match debug/logging and consumer expectations.Fixed
ReferenceErrorpath invalidate-branch-name.cjs.Removed
Checklist (Global DoD / PR)