Skip to content

Commit d0d06c9

Browse files
committed
CI: run the Action's default release-download install (#325)
The action job always builds subenum from source, so the path most users take, downloading and verifying the latest release, never ran in CI. A new action-release job runs the Action with version: latest on Linux, macOS and Windows on pushes to main, with no Go toolchain and no earlier build, so only the downloaded binary can do the scan. It checks the verdict, the found count and the results file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Refs #325
1 parent 77bd4ac commit d0d06c9

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

‎.github/workflows/go.yml‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,43 @@ jobs:
216216
grep -q '"change":"removed"' "${{ steps.diff.outputs.changes }}"
217217
grep -q 'gone.lab.example' "${{ steps.diff.outputs.changes }}"
218218
219+
# The action's default install path, as users get it: download the latest
220+
# release, check it against checksums.txt and its attestation, unpack it
221+
# (#325). The action job above builds from source and never reaches that
222+
# branch. Pushes to main only, since it needs a published release and the
223+
# network. A fresh job with no Go setup and no earlier build, so the scan
224+
# can only run the binary the release install put on PATH. The permissions
225+
# match the monitoring guide's example workflow. The scan uses -simulate
226+
# rather than a lab zone file from this checkout, whose format can be
227+
# newer than the release.
228+
action-release:
229+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
230+
runs-on: ${{ matrix.os }}
231+
permissions:
232+
contents: read
233+
strategy:
234+
fail-fast: false
235+
matrix:
236+
os: [ ubuntu-latest, macos-latest, windows-latest ]
237+
steps:
238+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
239+
240+
- name: Scan with the latest release
241+
id: scan
242+
uses: ./
243+
with:
244+
version: latest
245+
domain: lab.example
246+
args: -simulate
247+
248+
- name: Check the scan
249+
shell: bash
250+
run: |
251+
set -euo pipefail
252+
test "${{ steps.scan.outputs.verdict }}" = complete
253+
test "${{ steps.scan.outputs.found }}" -ge 1
254+
test -s "${{ steps.scan.outputs.results }}"
255+
219256
# Builds the Dockerfile for both published platforms without pushing, so a
220257
# broken image is caught on the PR rather than during a release.
221258
docker:

0 commit comments

Comments
 (0)