Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/git-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ jobs:
if: ${{ !startsWith(github.head_ref, 'dependabot/') && !startsWith(github.head_ref, 'renovate/') }}
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: read
steps:
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
script: |
const branch = context.payload.pull_request?.head?.ref || "";
const pattern = /^codex\/(feat|fix|chore|refactor|docs|test|perf|ci|spike|hotfix)\/[a-z0-9]+(?:-[a-z0-9]+)*$/;
if (!pattern.test(branch)) {
core.setFailed(`Invalid branch name: ${branch}`);
}
# Runs the repository's own guard rather than restating its rule. This job
# carried a second copy of the branch pattern and the two had drifted: the
# guard accepts <type>/<slug> and <agent>/<task-slug>, this copy accepted
# neither, so a branch the local hook blessed failed here. One rule, one
# place, pinned by the guard's own test suite.
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- run: bash scripts/git/guard-branch.sh

secrets:
runs-on: ubuntu-latest
Expand Down
Loading