Use relgap-action
relgap-action is a composite GitHub Action. It installs a relgap release, checks it before it runs, and can run relgap for you. The repository then needs no mise.toml entry for relgap. It runs on Linux, macOS and Windows runners.
Modes
The mode input picks what the step does:
install(the default) puts relgap onPATH. Later steps call it as they would any tool.reportrunsrelgap outdated(orrelgap driftwithcommand: drift) once. It writes JSON, Markdown, SARIF and annotations, uploads the SARIF to code scanning and appends the Markdown to the step summary.commentrunsrelgap digest --pull-requeston apull_requestevent and keeps one comment with the digest on the pull request, as Comment upgrade notes on Renovate pull requests describes.
In report and comment mode, fail-on passes --fail-on values, separated by commas or newlines. A match fails the step with exit 3 after the files, the upload and the comment are done. args adds more arguments, one per line.
A workflow
This workflow runs relgap outdated on pushes to main and every Monday, and the digest on pull requests that change a pin. Copy it to .github/workflows/relgap.yml:
# relgap through relgap-action: copy this file to .github/workflows/relgap.yml. The action installs
# a verified relgap release, so the repository needs no mise.toml entry for relgap.
#
# The outdated job runs relgap outdated, uploads the SARIF to code scanning, appends the Markdown
# to the step summary, and fails on an end-of-life or vulnerable pin. The digest job runs on pull
# requests that change a pin and keeps one comment with the release notes of each upgraded tool.
# Pull requests from forks and from Dependabot get a read-only GITHUB_TOKEN, so they get the step
# summary only.
name: relgap
on:
push:
branches: [main]
schedule:
- cron: "23 6 * * 1"
pull_request:
paths:
- "mise.toml"
- ".tool-versions"
- "**/*.tf"
- "**/*.hcl"
- "**/Dockerfile"
- ".github/workflows/*.yml"
permissions: {}
jobs:
outdated:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
security-events: write # the SARIF upload
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: sassdavid/relgap-action@518ce61cef05d84d2bd980c553bd24fdca9ed0c7 # v1.2.0
with:
mode: report
fail-on: eol, vuln
digest:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pull-requests: write # the comment
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # relgap reads the pins at the base commit
persist-credentials: false
- uses: sassdavid/relgap-action@518ce61cef05d84d2bd980c553bd24fdca9ed0c7 # v1.2.0
with:
mode: commentThe outdated job needs security-events: write for the SARIF upload, and the digest job needs pull-requests: write for the comment and fetch-depth: 0 so relgap can read the pins at the base commit. Pull requests from forks and from Dependabot get a read-only GITHUB_TOKEN, so they get the step summary only.
Verification
The action checks every archive against the release's checksums.txt (sha256), then runs the check that verify names:
attestation(the default) runsgh attestation verify, pinned to relgap's release workflow.cosignrunscosign verify-blobonchecksums.txtand needs cosign or mise onPATH.checksumstops after sha256. It catches a broken download, not a replaced release.
Security and verification shows the same checks for a manual install.
Inputs and outputs
From action.yml of sassdavid/relgap-action v1.2.0.
Inputs
| Input | Default | Description |
|---|---|---|
version | relgap version to install (X.Y.Z, vX.Y.Z or latest). Empty installs the version this action release pins in scripts/tool.env. | |
verify | attestation | The check after sha256 against checksums.txt. attestation runs gh attestation verify, pinned to relgap's release workflow. cosign runs cosign verify-blob on checksums.txt and needs cosign or mise on PATH. checksum adds nothing. |
mode | install | install puts relgap on PATH. report runs the command once, writes JSON, Markdown, SARIF and annotations, uploads the SARIF and writes the step summary. comment does the same on a pull_request event and keeps one comment on the pull request. |
command | The command that report and comment mode run. Empty runs the first one scripts/tool.env lists for the mode. | |
args | More arguments for the command, one per line. | |
from | A directory of results from an earlier step, passed with the flag that scripts/tool.env names. Only a tool that sets that flag takes it; see the README. | |
fail-on | Values for --fail-on, separated by commas or newlines. A match exits 3 and fails the step after the files, the SARIF upload and the comment. | |
sarif | true | Upload the SARIF file to code scanning (true or false). The job needs security-events write. |
step-summary | true | Append the Markdown report to the step summary (true or false). |
github-token | ${{ github.token }} | Token for gh attestation verify, the GitHub API calls of relgap, the SARIF upload and the pull request comment. |
working-directory | . | Directory the command runs in. SARIF locations are relative to it. |
Outputs
| Output | Description |
|---|---|
version | The installed relgap version, without a leading v. |
path | Absolute path of the relgap binary. |
exit-code | Exit code of the command in report and comment mode (0, 1, 2, 3 or 4). |
json-file | Absolute path of the JSON report; empty when the command wrote none. |
sarif-file | Absolute path of the SARIF file; empty when the command writes no SARIF. |
md-file | Absolute path of the Markdown report; empty when the command wrote none. |
The exit-code output lets a later step act on the result, for example exit 3 for a matched gate. Exit codes lists every code.