repomatic pr-body - Generate PR body with workflow metadata
repomatic pr-body [OPTIONS]
Generate a PR body with a collapsible workflow metadata block.
Reads GITHUB_* environment variables to produce a <details>
block listing the workflow metadata (documentation, trigger, actor, ref,
commit, job, workflow, run).
The prefix can be set via --template (built-in templates),
--prefix (arbitrary content, also via GHA_PR_BODY_PREFIX env var) or
--prefix-file (the same content read from a file, also via
GHA_PR_BODY_PREFIX_FILE). If a template and a prefix are both given, the
prefix is prepended before the rendered template content.
- GHA_PR_BODY_PREFIX
- Content to prepend before the metadata details block. Can also be set via
the GHA_PR_BODY_PREFIX environment variable.
- PR_BODY_PREFIX
- Content to prepend before the metadata details block. Can also be set via
the GHA_PR_BODY_PREFIX environment variable.
- GHA_PR_BODY_PREFIX_FILE
- Read the prefix from a file instead of --prefix, for a report too large to
travel in an environment variable. Can also be set via the
GHA_PR_BODY_PREFIX_FILE environment variable. Wins over --prefix when both
are given.
- PR_BODY_PREFIX_FILE
- Read the prefix from a file instead of --prefix, for a report too large to
travel in an environment variable. Can also be set via the
GHA_PR_BODY_PREFIX_FILE environment variable. Wins over --prefix when both
are given.
- PR_BODY_TEMPLATE
- Use a built-in prefix template instead of --prefix.
- PR_BODY_TEMPLATE_FILE
- Use an external template file (markdown with optional YAML frontmatter).
Mutually exclusive with --template. Lets downstream repos ship
project-specific PR templates without modifying repomatic. Templates
should set 'footer: false' in their frontmatter to avoid duplicating the
attribution footer that ships with the metadata block.
- PR_BODY_TEMPLATE_ARGS_CLI
- Pass an arbitrary key/value pair to the template. Repeat to provide
multiple. Use this to feed template variables not covered by the dedicated
--version / --part / --pr-ref flags. Example: --template-arg
channel=Nix.
- PR_BODY_TEMPLATE_ARG_FILES
- Read a template value from a file. Repeat to provide multiple. Use this
for a value with no ceiling on its size, like a generated table: a report
travels as a path rather than inline. Example: --template-arg-file
summary=proposal.md.
- PR_BODY_VERSION
- Version string passed to the template (e.g. 1.2.0).
- PR_BODY_PART
- Version part passed to the bump-version template.
- PR_BODY_PR_REF
- PR reference passed to detect-squash-merge template (e.g. #2316).
- PR_BODY_OUTPUT
- Output file path. Defaults to stdout.
- PR_BODY_OUTPUT_FORMAT
- Format for --output. 'github-actions' wraps body, title, and
commit_message as step output variables.
- PR_BODY__CLICK_DEFAULT_HELP
- Show this message and exit.
- 0
- Success.
- 1
- A runtime error, or an aborted prompt (Ctrl-C, a declined
confirmation).
- 2
- A usage error: unknown option, invalid value, missing operand, or an
unparsable configuration file.
Preview metadata block locally
CI: write as GitHub Actions step outputs
repomatic pr\-body \-\-output "$GITHUB_OUTPUT" \-\-output\-format github\-actions
Use a built-in template
repomatic pr\-body \-\-template bump\-version \-\-version 1.2.0 \-\-part minor
Use a downstream-shipped template with custom variables
repomatic pr\-body \-\-template\-file path/to/template.md \-\-template\-arg fruit=mango \-\-template\-arg crate=10
With a prefix via environment variable
GHA_PR_BODY_PREFIX="Fix formatting" repomatic pr\-body