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) or --prefix-file (the same content read from a
file). If a template and a prefix are both given, the prefix is prepended
before the rendered template content.
- PR_BODY_PREFIX
- Content to prepend before the metadata details block.
- PR_BODY_PREFIX_FILE
- Read the prefix from a file instead of --prefix, for a report too large to
pass as an argument. Wins over --prefix when both are given.
- PR_BODY_TEMPLATE
- Built-in template to render the content from.
- PR_BODY_TEMPLATE_FILE
- Template file to render the content from, instead of --template: markdown
with optional YAML frontmatter, for project-specific content. Set 'footer:
false' in its frontmatter: the metadata block already carries the
attribution footer.
- 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
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 (like 1.2.0).
- PR_BODY_PART
- Version part passed to the bump-version template.
- PR_BODY_OUTPUT
- Write the PR body to this file. github-actions writes the body, title and
commit message as step outputs.
- PR_BODY_OUTPUT_FORMAT
- Format of the --output file. github-actions writes step outputs, for
$GITHUB_OUTPUT.
- PR_BODY__CLICK_DEFAULT_HELP
- Show this message and exit.
- 0
- Success.
- 1
- A runtime error, an aborted prompt (Ctrl-D), or a declined
confirmation.
- 2
- A usage error: unknown option, invalid value, missing operand, or an
unparsable configuration file.
- 130
- Interrupted with Ctrl-C: the process ends by SIGINT, reported as 130.
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 above the metadata block
repomatic pr\-body \-\-prefix "Fix formatting"