Skip to content

release: provenance attestation, CycloneDX SBOM and dry-run trigger - #219

Merged
BaaRai merged 1 commit into
mainfrom
feat/release-provenance
Nov 13, 2026
Merged

BaaRai merged 1 commit into
mainfrom
feat/release-provenance

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Summary

release.yml built five zips and published SHA256SUMS, with no provenance and no SBOM. This PR adds both, plus a dry-run trigger. No cosign, no signature.

Provenance attestation

  • The release job now declares id-token: write and attestations: write, and runs actions/attest-build-provenance with subject-path: dist/*.zip.
  • contents stays write on this job, not read: job-level permissions replace the workflow-level ones, and softprops/action-gh-release needs contents: write to create the Release.
  • User-side check: gh attestation verify <zip> --repo BaaRai/ARTEX.

CycloneDX SBOM

  • The release job downloads the bin-linux-amd64 artifact (already uploaded by binaries), copies go.mod, go.sum and web/package-lock.json next to it, and runs syft scan dir:... to produce dist/artex-<tag>.cdx.json (CycloneDX JSON).
  • The step fails unless the file contains pkg:golang/ and pkg:npm/ entries (plain grep).
  • Syft comes from anchore/sbom-action/download-syft pinned by SHA, with syft-version: v1.54.0 (the default at that SHA, made explicit).
  • The SBOM is attached to the Release next to SHA256SUMS.

Dry run (workflow_dispatch)

  • New workflow_dispatch trigger. The dry run builds, generates the SBOM, creates the attestations and uploads workflow artifacts (pkg-*, bin-linux-*, and a new release-metadata artifact with SHA256SUMS + SBOM).
  • softprops/action-gh-release runs only when github.event_name == 'push', so a dry run creates no Release and no tag.
  • The docker job keeps its condition and gets the same event condition: vars.DOCKERHUB_ENABLED == 'true' && github.event_name == 'push'. Without it, a dry run with DOCKERHUB_ENABLED set would push latest.
  • In a dry run github.ref_name is the branch name, so the SBOM is named artex-main.cdx.json, the binaries are stamped with main, and the CHANGELOG step falls back to the generic body (with its existing warning).

Pinned actions (new ones only; existing actions are not re-pinned here)

  • actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 (v4.2.2, lightweight tag pointing at this commit)
  • anchore/sbom-action/download-syft@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c (v0.24.3, annotated tag fffec3d8… dereferenced to this commit)

README

New "Verifying a release" section under the prebuilt-binaries option: sha256sum -c SHA256SUMS, gh attestation verify <zip> --repo BaaRai/ARTEX, and where the SBOM is attached. It states that older releases have neither.

Tests

  • No actionlint installed: the workflow was parsed with Python yaml.safe_load (PyYAML 6.0.3). It parses, triggers are push + workflow_dispatch, the Release step has if: github.event_name == 'push', and the docker job condition is as above.
  • I reproduced the SBOM step locally with syft 1.54.0 (release tarball, checksum checked) on a locally built ./cmd/artex linux/amd64 binary, plus the same three files and the same command and greps. Both greps pass. The CycloneDX 1.7 output has 52 pkg:golang components from go-module-binary-cataloger, 53 from go-module-file-cataloger and 687 pkg:npm from javascript-lock-cataloger. The local binary was built without -tags embedui, so the exact module set in CI may differ slightly.

Limits

  • workflow_dispatch can only be run once this file is on main, so the real dry run happens after merge.
  • The attestation step cannot be checked here. A real gh attestation verify needs a real tag, or at least a dry run after merge. A dry run also creates real attestations, which are public for a public repository, for the main build.
  • No release, tag or image push was triggered for this PR.

…un trigger

- release job: attest dist/*.zip with actions/attest-build-provenance
  (id-token: write, attestations: write; contents stays write for the Release).
- SBOM: syft scans the bin-linux-amd64 binary (embedded Go modules), plus
  web/package-lock.json and go.mod/go.sum; artex-<tag>.cdx.json is checked for
  pkg:golang and pkg:npm entries and attached next to SHA256SUMS.
- workflow_dispatch dry run: builds, SBOM, attestations and workflow artifacts;
  the Release step and the docker job only run on push.
- README: Verifying a release section.
@BaaRai
BaaRai merged commit 4e126a8 into main Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant