@@ -73,20 +73,25 @@ See [action.yml](action.yml)
73
73
- uses: actions/attest-sbom@v2
74
74
with:
75
75
# Path to the artifact serving as the subject of the attestation. Must
76
- # specify exactly one of "subject-path" or "subject-digest". May contain a
77
- # glob pattern or list of paths (total subject count cannot exceed 1024).
76
+ # specify exactly one of "subject-path", "subject-digest", or
77
+ # "subject-checksums". May contain a glob pattern or list of paths
78
+ # (total subject count cannot exceed 1024).
78
79
subject-path:
79
80
80
81
# SHA256 digest of the subject for the attestation. Must be in the form
81
82
# "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one
82
- # of "subject-path" or "subject-digest ".
83
+ # of "subject-path", "subject-digest", or "subject-checksums ".
83
84
subject-digest:
84
85
85
- # Subject name as it should appear in the attestation. Required unless
86
- # "subject-path" is specified, in which case it will be inferred from the
87
- # path.
86
+ # Subject name as it should appear in the attestation. Required when
87
+ # identifying the subject with the "subject-digest" input.
88
88
subject-name:
89
89
90
+ # Path to checksums file containing digest and name of subjects for
91
+ # attestation. Must specify exactly one of "subject-path", "subject-digest",
92
+ # or "subject-checksums".
93
+ subject-checksums:
94
+
90
95
# Path to the JSON-formatted SBOM file to attest. File size cannot exceed
91
96
# 16MB.
92
97
sbom-path:
@@ -203,6 +208,41 @@ newline delimited list:
203
208
dist/bar
204
209
` ` `
205
210
211
+ # ## Identify Subjects with Checksums File
212
+
213
+ If you are using tools like
214
+ [goreleaser](https://goreleaser.com/customization/checksum/) or
215
+ [jreleaser](https://jreleaser.org/guide/latest/reference/checksum.html) which
216
+ generate a checksums file you can identify the attestation subjects by passing
217
+ the path of the checksums file to the `subject-checksums` input. Each of the
218
+ artifacts identified in the checksums file will be listed as a subject for the
219
+ attestation.
220
+
221
+ ` ` ` yaml
222
+ - name: Calculate artifact digests
223
+ run: |
224
+ shasum -a 256 foo_0.0.1_* > subject.checksums.txt
225
+ - uses: actions/attest-sbom@v2
226
+ with:
227
+ subject-checksums: subject.checksums.txt
228
+ sbom-path: sbom.spdx.json
229
+ ` ` `
230
+
231
+ <!-- markdownlint-disable MD038 -->
232
+
233
+ The file referenced by the `subject-checksums` input must conform to the same
234
+ format used by the shasum tools. Each subject should be listed on a separate
235
+ line including the hex-encoded digest (either SHA256 or SHA512), a space, a
236
+ single character flag indicating either binary (`*`) or text (` `) input mode,
237
+ and the filename.
238
+
239
+ <!-- markdownlint-enable MD038 -->
240
+
241
+ ` ` ` text
242
+ b569bf992b287f55d78bf8ee476497e9b7e9d2bf1c338860bfb905016218c740 foo_0.0.1_darwin_amd64
243
+ a54fc515e616cac7fcf11a49d5c5ec9ec315948a5935c1e11dd610b834b14dde foo_0.0.1_darwin_arm64
244
+ ` ` `
245
+
206
246
# ## Container Image
207
247
208
248
When working with container images you can invoke the action with the
0 commit comments