Composite action that validates head branch and PR title against the fritzlab naming standard (role/bug-id/kebab + [bug-id] titles). Always exits 0 (warn-only) until the Bugs system is live. - check.sh: validation logic (branch form, title form, bug-id cross-check) - action.yaml: composite action wrapping check.sh - tests/run: 20-case test matrix (valid/invalid/chore/mismatch/dfritz) - .gitea/workflows/test.yaml: CI that runs the test suite Closes fritzlab/agenthub#559
action/check-naming
Composite Gitea Action that validates a pull request's head branch name and title against the fritzlab naming standard. Always exits 0 — warn-only until the Bugs tracking system is live (see fritzlab/agenthub#557).
Standard
Branch: <role>/bug-<id>/<kebab-description> e.g. dev/bug-x7k2m9/fix-terminal-resize
Chore: chore/<kebab-description> bug-less trivia only (dep bumps, typos, CI tweaks)
Title: [bug-x7k2m9] Fix terminal resize loss (chore PRs: no [bug-id] prefix)
<role>must be a roster handle:dev|ux|ops|security|perf|architect|support<bug-id>isbug-followed by lowercase alphanumeric characters<kebab-description>is lowercase alphanumeric with hyphens, starting with a letter or digit- When both the branch and the title carry a bug-id they must match
- Break-glass: PRs authored by
dfritzare exempt from all checks
Usage
jobs:
naming:
runs-on: fritzlab
timeout-minutes: 5
continue-on-error: true # non-required until Bugs cutover
steps:
- uses: https://code.fritzlab.net/action/check-naming@v1
with:
head-branch: ${{ github.head_ref }}
pr-title: ${{ github.event.pull_request.title }}
pr-author: ${{ github.event.pull_request.user.login }}
Inputs
| Name | Required | Description |
|---|---|---|
head-branch |
yes | Head branch name — github.head_ref |
pr-title |
yes | PR title — github.event.pull_request.title |
pr-author |
no | PR author login — github.event.pull_request.user.login; dfritz is exempt |
Behavior
The check validates two things:
-
Branch form — must be
<role>/bug-<id>/<kebab>orchore/<kebab>. Unknown roles, missingbug-segment, uppercase bug-ids, and empty kebab descriptions all produce aWARN[check-naming]log line. -
Title form — for a
role/bugbranch the title should start with[bug-<id>]. For achorebranch the title should have no[bug-id]prefix. If both carry a bug-id they must match.
All violations print a WARN[check-naming]: ... line. The step always
exits 0 so it cannot block a PR. To harden to required after the Bugs
cutover: remove continue-on-error: true from the consuming workflow
and add the job's context to the repo's status_check_contexts.
Tests
bash tests/run