Authored-By: Codex (GPT-5) <noreply@openai.com>
action/check-naming
Composite Gitea Action that validates a pull request's branch, title, Bug
tracking, and AI authorship against the fritzlab Git standard. The current
action fails (exits 1) on any violation; @v1 is the legacy warn-only release
(Bugs program: 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
- Titles are plain-language imperatives without Conventional Commit syntax
- Break-glass: PRs authored by
dfritzare exempt from all checks
Usage
jobs:
naming:
runs-on: fritzlab
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: https://code.fritzlab.net/action/check-naming@<commit-sha>
with:
head-branch: ${{ github.head_ref }}
pr-title: ${{ github.event.pull_request.title }}
pr-author: ${{ github.event.pull_request.user.login }}
pr-body: ${{ github.event.pull_request.body }}
server-url: ${{ github.server_url }}
token: ${{ github.token }}
base-sha: ${{ github.event.pull_request.base.sha }}
head-sha: ${{ github.event.pull_request.head.sha }}
To wire a new repo warn-only first, add continue-on-error: true to the
job — the step still fails, but the job cannot block the PR.
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 |
pr-body |
yes | PR description — github.event.pull_request.body |
server-url |
yes | Gitea server URL — github.server_url |
token |
yes | Gitea Actions token — github.token |
base-sha |
yes | Base commit — github.event.pull_request.base.sha |
head-sha |
yes | Head commit — github.event.pull_request.head.sha |
Behavior
The check validates four things for every non-break-glass Agent PR:
-
Branch form — must be
<role>/bug-<id>/<kebab>orchore/<kebab>. Unknown roles, missingbug-segment, uppercase bug-ids, and empty kebab descriptions all produce aFAIL[check-naming]log line. -
Title form — for a
role/bugbranch the title must start with[bug-<id>]. For achorebranch the title must have no[bug-id]prefix. If both carry a bug-id they must match. Neither form accepts Conventional Commit syntax. -
Tracking and attribution — on Bug-backed work,
## Trackingcontains both the literalFixes bug-<id>automation token and the matching navigablehttps://agenthub.fritzlab.net/bug-<id>URL. Every PR has a separate## Attributionsection containing the canonicalAuthored-Byproduct/model watermark. The action asks Gitea to render the body with a bounded 5-second connection and 15-second total wait, then checks visible<h2>sections outside collapsed<details>content. Fenced, commented, scripted, or collapsed copies do not satisfy the visible provenance contract. -
Commit attribution — every commit in
base-sha..head-sha, including commits onchore/branches, ends with the canonicalAuthored-Bytrailer, separated from the message body by a blank line. The naming job must check out full history before this action.
Every violation prints a FAIL[check-naming]: ... line and the step
exits 1. To make the check required on a repo: drop any
continue-on-error: true from the consuming workflow and add the job's
context to the repo's status_check_contexts in agenthub hub/hub.yaml.
Versions
- unreleased — adds Bug tracking plus PR and commit attribution enforcement.
v2— enforces branch and title naming.v1— legacy warn-only: logsWARNlines, always exits 0.
Tests
bash tests/run