Repository navigation
release: provenance attestation, CycloneDX SBOM and dry-run trigger - #219
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release.ymlbuilt five zips and publishedSHA256SUMS, with no provenance and no SBOM. This PR adds both, plus a dry-run trigger. No cosign, no signature.Provenance attestation
releasejob now declaresid-token: writeandattestations: write, and runsactions/attest-build-provenancewithsubject-path: dist/*.zip.contentsstayswriteon this job, notread: job-level permissions replace the workflow-level ones, andsoftprops/action-gh-releaseneedscontents: writeto create the Release.gh attestation verify <zip> --repo BaaRai/ARTEX.CycloneDX SBOM
releasejob downloads thebin-linux-amd64artifact (already uploaded bybinaries), copiesgo.mod,go.sumandweb/package-lock.jsonnext to it, and runssyft scan dir:...to producedist/artex-<tag>.cdx.json(CycloneDX JSON).pkg:golang/andpkg:npm/entries (plaingrep).anchore/sbom-action/download-syftpinned by SHA, withsyft-version: v1.54.0(the default at that SHA, made explicit).SHA256SUMS.Dry run (
workflow_dispatch)workflow_dispatchtrigger. The dry run builds, generates the SBOM, creates the attestations and uploads workflow artifacts (pkg-*,bin-linux-*, and a newrelease-metadataartifact withSHA256SUMS+ SBOM).softprops/action-gh-releaseruns only whengithub.event_name == 'push', so a dry run creates no Release and no tag.dockerjob keeps its condition and gets the same event condition:vars.DOCKERHUB_ENABLED == 'true' && github.event_name == 'push'. Without it, a dry run withDOCKERHUB_ENABLEDset would pushlatest.github.ref_nameis the branch name, so the SBOM is namedartex-main.cdx.json, the binaries are stamped withmain, 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 tagfffec3d8…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
actionlintinstalled: the workflow was parsed with Pythonyaml.safe_load(PyYAML 6.0.3). It parses, triggers arepush+workflow_dispatch, the Release step hasif: github.event_name == 'push', and the docker job condition is as above../cmd/artexlinux/amd64 binary, plus the same three files and the same command and greps. Both greps pass. The CycloneDX 1.7 output has 52pkg:golangcomponents fromgo-module-binary-cataloger, 53 fromgo-module-file-catalogerand 687pkg:npmfromjavascript-lock-cataloger. The local binary was built without-tags embedui, so the exact module set in CI may differ slightly.Limits
workflow_dispatchcan only be run once this file is onmain, so the real dry run happens after merge.gh attestation verifyneeds 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 themainbuild.