Action — setup-promtool
Installs promtool (from the Prometheus release) and yq into $RUNNER_TEMP/bin, added to PATH. It backs the install step of ci-prometheus.yml.
Usage
yaml
steps:
- uses: KevinDeBenedetti/github-workflows/.github/actions/setup-promtool@main
with:
promtool-version: X.Y.Z # no leading v
yq-version: vX.Y.Z # with the leading vInputs
| Input | Default | Description |
|---|---|---|
promtool-version | (required) | Prometheus release providing promtool, without the leading v |
yq-version | (required) | mikefarah/yq release tag, with the leading v |
Steps
- Pick the runner's architecture (
amd64orarm64; anything else fails). - Download the Prometheus tarball and the release's
sha256sums.txt, check the tarball against its line, and extractpromtool. - Download the yq binary, the release's
checksumsandchecksums_hashes_order, read the SHA-256 column thatchecksums_hashes_ordernames, and check the binary. - Add
$RUNNER_TEMP/bintoPATH.
Notes
- The versions are the caller's, so no checksum is pinned here, unlike
install-tool: each asset is checked against the list published in its own release. That catches a corrupted or swapped asset, not a fully compromised release. - A missing entry fails with the asset's name (
no SHA-256 for … in …), and a failed check installs nothing onPATH. - Downloads are retried 5 times, for GitHub's occasional 5xx.
- The script is
setup-promtool.sh; its tests are intests/setup-promtool.bats.