Skip to content

Commit dcd16d8

Browse files
committed
GitHub Actions: Simplify attest
- Follow GoReleaser's [recommended attest workflow](https://goreleaser.com/customization/publish/attestations/) - Remove [depercated](https://github.com/actions/attest-sbom/blob/c604332985a26aa8cf1bdc465b92731239ec6b9e/README.md#L4-L7) `attest-sbom` action
1 parent 3f12f31 commit dcd16d8

2 files changed

Lines changed: 16 additions & 87 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -30,70 +30,6 @@ jobs:
3030
args: release
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_ACCESS_TOKEN }}
33-
34-
- uses: actions/attest-build-provenance@v4
35-
with:
36-
show-summary: false
37-
subject-checksums: ./dist/trellis_checksums.txt
38-
39-
- uses: actions/attest-sbom@v4
40-
with:
41-
show-summary: false
42-
subject-checksums: ./dist/trellis_checksums.txt
43-
sbom-path: ./dist/trellis_Darwin_arm64.tar.gz.sbom.json
44-
- uses: actions/attest-sbom@v4
45-
with:
46-
show-summary: false
47-
subject-checksums: ./dist/trellis_checksums.txt
48-
sbom-path: ./dist/trellis_Darwin_x86_64.tar.gz.sbom.json
49-
- uses: actions/attest-sbom@v4
50-
with:
51-
show-summary: false
52-
subject-checksums: ./dist/trellis_checksums.txt
53-
sbom-path: ./dist/trellis_Linux_arm64.tar.gz.sbom.json
54-
- uses: actions/attest-sbom@v4
55-
with:
56-
show-summary: false
57-
subject-checksums: ./dist/trellis_checksums.txt
58-
sbom-path: ./dist/trellis_Linux_i386.tar.gz.sbom.json
59-
- uses: actions/attest-sbom@v4
33+
- uses: actions/attest@v4
6034
with:
61-
show-summary: false
6235
subject-checksums: ./dist/trellis_checksums.txt
63-
sbom-path: ./dist/trellis_Linux_x86_64.tar.gz.sbom.json
64-
- uses: actions/attest-sbom@v4
65-
with:
66-
show-summary: false
67-
subject-checksums: ./dist/trellis_checksums.txt
68-
sbom-path: ./dist/trellis_Windows_arm64.zip.sbom.json
69-
- uses: actions/attest-sbom@v4
70-
with:
71-
show-summary: false
72-
subject-checksums: ./dist/trellis_checksums.txt
73-
sbom-path: ./dist/trellis_Windows_i386.zip.sbom.json
74-
- uses: actions/attest-sbom@v4
75-
with:
76-
show-summary: false
77-
subject-checksums: ./dist/trellis_checksums.txt
78-
sbom-path: ./dist/trellis_Windows_x86_64.zip.sbom.json
79-
80-
verify:
81-
needs: [goreleaser]
82-
runs-on: ubuntu-latest
83-
steps:
84-
- run: gh release download --clobber --dir artifacts -p '*.tar.gz' -p '*.zip' -p '*.sbom.json' --repo $REPO $TAG
85-
env:
86-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
REPO: ${{ github.repository }}
88-
TAG: ${{ github.ref_name }}
89-
- run: tree artifacts
90-
- run: ls | xargs -I {} gh attestation verify --repo $REPO {}
91-
working-directory: artifacts
92-
env:
93-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
REPO: ${{ github.repository }}
95-
- run: ls *.sbom.json | xargs -I {} gh attestation verify --predicate-type https://spdx.dev/Document/v2.3 --repo $REPO {}
96-
working-directory: artifacts
97-
env:
98-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99-
REPO: ${{ github.repository }}

README.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,27 @@ setup after downloading the Windows build:
8585
trellis-cli artifacts can be [cryptographically verified via GitHub CLI](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#verifying-artifact-attestations-with-the-github-cli).
8686

8787
```console
88-
# The archive with both predicates
8988
$ gh attestation verify --repo roots/trellis-cli /path/to/trellis_Darwin_arm64.tar.gz
90-
## ...snipped...
91-
✓ Verification succeeded!
92-
93-
sha256:xxx was attested by:
94-
REPO PREDICATE_TYPE WORKFLOW
95-
roots/trellis-cli https://slsa.dev/provenance/v1 .github/workflows/release.yml@refs/tags/v9.8.7
96-
roots/trellis-cli https://spdx.dev/Document/v2.3 .github/workflows/release.yml@refs/tags/v9.8.7
9789

98-
# The binary
99-
$ gh attestation verify --repo roots/trellis-cli /path/to/trellis
100-
## ...snipped...
101-
✓ Verification succeeded!
90+
Loaded digest sha256:xxxxxxx for file://path/to/trellis_Darwin_arm64.tar.gz
91+
Loaded 1 attestation from GitHub API
10292

103-
sha256:xxx was attested by:
104-
REPO PREDICATE_TYPE WORKFLOW
105-
roots/trellis-cli https://slsa.dev/provenance/v1 .github/workflows/release.yml@refs/tags/v9.8.7
93+
The following policy criteria will be enforced:
94+
- Predicate type must match:................ https://slsa.dev/provenance/v1
95+
- Source Repository Owner URI must match:... https://github.com/roots
96+
- Source Repository URI must match:......... https://github.com/roots/trellis-cli
97+
- Subject Alternative Name must match regex: (?i)^https://github.com/roots/trellis-cli/
98+
- OIDC Issuer must match:................... https://token.actions.githubusercontent.com
10699

107-
# The SBOM
108-
$ gh attestation verify --repo roots/trellis-cli /path/to/trellis_Darwin_arm64.tar.gz.sbom.json
109-
## ...snipped...
110100
✓ Verification succeeded!
111101

112-
sha256:xxx was attested by:
113-
REPO PREDICATE_TYPE WORKFLOW
114-
roots/trellis-cli https://slsa.dev/provenance/v1 .github/workflows/release.yml@refs/tags/v9.8.7
102+
The following 1 attestation matched the policy criteria
103+
104+
- Attestation #1
105+
- Build repo:..... roots/trellis-cli
106+
- Build workflow:. .github/workflows/release.yml@refs/tags/v0.0.1
107+
- Signer repo:.... roots/trellis-cli
108+
- Signer workflow: .github/workflows/release.yml@refs/tags/v0.0.1
115109
```
116110

117111
## Shell Integration
@@ -309,4 +303,3 @@ Keep track of development and community news.
309303
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
310304
- Follow the [Roots Blog](https://roots.io/blog/)
311305
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
312-

0 commit comments

Comments
 (0)