rrt CI & Automation
rrt CI & Automation
Section titled “rrt CI & Automation”rrt action
Section titled “rrt action”Scaffold GitHub Actions workflows for repo-release-tools.
Overview
Section titled “Overview”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.
Responsibilities
Section titled “Responsibilities”- generate starter GitHub Actions workflows using the current
rrtversion - automate the integration of
repo-release-toolsinto the project’s CI - provide safe file operations with dry-run and force-overwrite protections
- emit high-signal, formatted feedback during the scaffolding process
Workflow Content
Section titled “Workflow Content”The generated workflow (.github/workflows/rrt.yml) includes:
- Triggers: Runs on
pushto the main branch and on allpull_requestevents. - Environment: Executes on the latest Ubuntu runner.
- Steps:
- Full history checkout (
fetch-depth: 0) to support git-based checks. - Execution of
Anselmoo/repo-release-toolswith standard policy flags (branch name, commit subject, and changelog checks).
- Full history checkout (
Behavior
Section titled “Behavior”- Writes to
.github/workflows/rrt.ymlrelative to the current working directory. - Refuses to overwrite an existing workflow unless
--forceis provided. - Supports
--dry-runto preview the generated YAML in the terminal without writing to disk. - Uses syntax highlighting when displaying the workflow preview in dry-run mode.
Examples
Section titled “Examples”rrt action initrrt action init --dry-runrrt action init --force
Caveats
Section titled “Caveats”- Requires a Git repository with a
.github/workflowsdirectory structure (automatically created if missing). - The generated version pin matches the version of
rrtcurrently in use.
Related docs
Section titled “Related docs”- Generated CLI reference — full command surface
- CI automation commands — the
actioncommand group - GitHub Action — the composite action this workflow invokes
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 --forcerrt action init
Section titled “rrt action init”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 --forcerrt gate
Section titled “rrt gate”Run a declared list of check lines, each against the exit code it is designed to produce.
Overview
Section titled “Overview”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.
Configuration
Section titled “Configuration”[[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 = 1timeout = 600runas a string executes throughbash -o pipefail -c. The caller’s shell is never assumed, and a pipeline reports its first failing element.runas a list executes as argv with no shell at all.expectdefaults to0.timeoutis optional, in seconds.
Examples
Section titled “Examples”rrt gate runrrt gate run seeded-defect unitrrt gate run --dry-run
Caveats
Section titled “Caveats”- String-form lines need
bashonPATH. 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_runtool defaults to a dry run because it executes repository commands.
Related docs
Section titled “Related docs”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.rrt gate run
Section titled “rrt gate run”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-runBadge 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.