Skip to content
repo-release-tools
GitHub

rrt CI & Automation

Scaffold GitHub Actions workflows for repo-release-tools.

rrt action manages the bootstrapping of GitHub Actions workflows to automate repository policy checks. It centralizes the creation of standard CI configurations, ensuring that repo-release-tools is correctly integrated into the project’s development lifecycle.

The primary subcommand is init, which writes a pre-configured workflow file that performs branch naming, commit subject, and changelog verification on every push and pull request.

  • generate starter GitHub Actions workflows using the current rrt version
  • automate the integration of repo-release-tools into the project’s CI
  • provide safe file operations with dry-run and force-overwrite protections
  • emit high-signal, formatted feedback during the scaffolding process

The generated workflow (.github/workflows/rrt.yml) includes:

  • Triggers: Runs on push to the main branch and on all pull_request events.
  • Environment: Executes on the latest Ubuntu runner.
  • Steps:
    • Full history checkout (fetch-depth: 0) to support git-based checks.
    • Execution of Anselmoo/repo-release-tools with standard policy flags (branch name, commit subject, and changelog checks).
  • Writes to .github/workflows/rrt.yml relative to the current working directory.
  • Refuses to overwrite an existing workflow unless --force is provided.
  • Supports --dry-run to preview the generated YAML in the terminal without writing to disk.
  • Uses syntax highlighting when displaying the workflow preview in dry-run mode.
  • rrt action init
  • rrt action init --dry-run
  • rrt action init --force
  • Requires a Git repository with a .github/workflows directory structure (automatically created if missing).
  • The generated version pin matches the version of rrt currently in use.
Usage: rrt action [OPTIONS] <action_command>
Scaffold a starter GitHub Actions workflow that runs repo-release-tools checks.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Arguments
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
init Write a starter workflow that uses repo-release-tools.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Options
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-h, --help Show this message and exit.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Examples
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ rrt action init
$ rrt action init --dry-run
$ rrt action init --force
Usage: rrt action init [OPTIONS]
Write a starter .github/workflows/rrt.yml workflow for repo-release-tools CI.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Arguments
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Options
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-h, --help Show this message and exit.
--dry-run Preview without writing files.
--force Overwrite an existing workflow file.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Examples
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ rrt action init
$ rrt action init --dry-run
$ rrt action init --force

Run a declared list of check lines, each against the exit code it is designed to produce.

rrt gate run executes every [[tool.rrt.gates]] line and compares its exit code with the line’s expect value. A list joined with && stops at the first non-zero exit. That silently skips every later check, even when the red line was red on purpose. Here every line runs regardless of earlier results.

The report is a table of expected exit, actual exit, and verdict. The command exits 0 only when every verdict matches. A deliberately failing check, such as a seeded defect whose test must fail, therefore passes when it fails as designed.

[[tool.rrt.gates]]
name = "unit"
run = "uv run pytest -q | tail -3"
[[tool.rrt.gates]]
name = "seeded-defect"
run = ["uv", "run", "pytest", "tests/test_seeded.py"]
expect = 1
timeout = 600
  • run as a string executes through bash -o pipefail -c. The caller’s shell is never assumed, and a pipeline reports its first failing element.
  • run as a list executes as argv with no shell at all.
  • expect defaults to 0. timeout is optional, in seconds.
  • rrt gate run
  • rrt gate run seeded-defect unit
  • rrt gate run --dry-run
  • String-form lines need bash on PATH. Use the list form where no shell exists.
  • A missing executable or a timeout fails its line with an error, never a crash.
  • Lines run sequentially from the repository root, with stdin closed.
  • Output is captured. The tail of each mismatched line is shown so a failure stays explainable.
  • The MCP rrt_gate_run tool defaults to a dry run because it executes repository commands.
Usage: rrt gate [OPTIONS] <gate_command>
Run [[tool.rrt.gates]] check lines. Every line runs regardless of earlier results, and each is judged against the exit code it is designed to produce.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Arguments
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
run Run every gate line (or the named ones) and report expected / actual / verdict.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Options
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-h, --help Show this message and exit.
Usage: rrt gate run [OPTIONS] NAME
Run gate lines and exit 0 only when every line matched its expected exit.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Arguments
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
NAME Gate names to run.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Options
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-h, --help Show this message and exit.
--dry-run Preview without running gate commands.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Examples
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ rrt gate run
$ rrt gate run seeded-defect unit
$ rrt gate run --dry-run

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.