Skip to content
repo-release-tools
GitHub

GitHub Action

Use the GitHub Action when you want CI to enforce the same policy that rrt-hooks can enforce locally.

The composite Action runs rrt-hooks checks inside a GitHub Actions job. It validates branch names, Conventional Commit subjects, and changelog policy. Optional inputs add doctor, release-health, folder, and artifact checks. Reach for it when CI has to be the gate, not just the contributor’s machine.

- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: Anselmoo/repo-release-tools@v1.18.0
with:
check-branch-name: "true"
check-commit-subject: "true"
check-changelog: "true"

fetch-depth: 0 is required because changelog and commit-subject checks use git log and commit metadata. A shallow checkout makes those checks flaky at best and misleading at worst — tiny chaos gremlin, large confusion.

  • branch naming
  • Conventional Commit subjects
  • changelog policy
  • optional clean-worktree enforcement
  • optional rrt doctor core automation checks
  • optional rrt release check release-target validation
  • optional folder structure validation (check-folder)
  • optional artifact hash integrity (check-artifacts)

Changelog strategy: use auto unless you have a reason not to

Section titled “Changelog strategy: use auto unless you have a reason not to”

changelog-strategy controls how CI decides whether a changelog is valid.

Strategy When to use it What passes
auto (default) most repositories follows changelog_workflow from repo config
per-commit every changelog-relevant commit must touch CHANGELOG.md CHANGELOG.md appears in the commit’s changed files
unreleased you maintain [Unreleased] continuously, often via hooks ## [Unreleased] is non-empty
release-only changelog is generated or reviewed only when cutting a release check is skipped during normal CI
changelog_workflow Action behavior when changelog-strategy: auto
incremental (default) resolves to per-commit
squash resolves to release-only
not configured resolves to per-commit

Use an explicit override only when you want CI to be stricter or looser than the repo default. A common example is pairing local rrt-update-unreleased hooks with CI changelog-strategy: "unreleased".

- uses: Anselmoo/repo-release-tools@v1.18.0
with:
check-changelog: "true"
changelog-strategy: "auto"
- uses: Anselmoo/repo-release-tools@v1.18.0
with:
check-changelog: "true"
changelog-strategy: "unreleased"
- uses: Anselmoo/repo-release-tools@v1.18.0
with:
check-changelog: "true"
changelog-strategy: "release-only"
Input Default Description
check-branch-name "true" Validate branch naming convention
check-commit-subject "true" Validate Conventional Commit subject
check-changelog "true" Validate changelog policy for changelog-relevant commits
changelog-strategy "auto" auto / incremental / per-commit / unreleased / release-only
changelog-file "CHANGELOG.md" Path to changelog file
check-dirty-tree "false" Fail when generated files leave the work tree dirty
check-doctor "false" Run rrt doctor core automation checks
check-release-health "false" Run rrt release check for version targets, pin targets, and changelog files
check-folder "false" Fail if the repository folder structure violates [tool.rrt.folders] config
check-artifacts "false" Fail if generated artifact hashes disagree with .rrt/artifacts.lock.toml
branch-name — Override the branch name to validate
branch-ref-type — Override branch ref type detection
commit-subject — Override the commit subject to validate

check-dirty-tree defaults to "false" because GitHub Actions checkouts are normally clean already. Turn it on when a workflow generates files and you want the job to assert that nothing was left uncommitted.

check-doctor runs rrt doctor, which verifies core automation wiring such as hook and CI integration surfaces.

check-release-health runs rrt release check, which verifies that version targets, pin targets, and changelog files in repo config are reachable and well-formed. It is the better release gate when your repository relies on config-driven version updates.

check-folder runs rrt-hooks folder-check, which validates the repository directory layout against the [tool.rrt.folders] configuration. Use it to enforce a consistent project structure across contributors and CI environments.

check-artifacts runs rrt-hooks artifacts-check, which compares generated artifact hashes against the committed .rrt/artifacts.lock.toml. It detects artifacts that were regenerated but not re-snapshotted, or vice versa.

Output Description
detected-version Published version for this run, printed by rrt ci-version compute
changelog-status clean, dirty, or missing for the [Unreleased] section
health-summary JSON object summarising the policy check results

detected-version follows the rrt ci-version compute rules. A v* tag build yields the tag without its leading v. A main build yields {base}.dev{run_id}{run_attempt:02d}. Any other ref yields the configured base version. The output is empty when no version target can be read.

  • fetch-depth: 0 is required. Shallow checkouts break the changelog and commit-subject checks.
  • Tag-triggered workflows skip branch-name validation automatically.
  • The action installs repo-release-tools from the action checkout, not from the consumer repository.
  • changelog-strategy defaults to auto, so CI can follow repository config instead of forcing one changelog policy everywhere.
  • Only check-branch-name, check-commit-subject and check-changelog default to "true". Every other check is opt-in, including dirty-tree, doctor, release-health, eol, docs, folder and artifacts.
  • The version pin in each example tracks the current release. Pin the tag you actually want.

Badge families are intentionally complete for the current icon registry across platform, registry, and language labels; see src/repo_release_tools/tools/platform.py if you think one is missing.

Chat is powered by Context7, a third-party service with its own terms and privacy policy.