bump actions/attest from v2.1.0 to v2.2.0 (#148)

Includes support for new subject-checksums input parameter

Signed-off-by: Brian DeHamer <[email protected]>
This commit is contained in:
Brian DeHamer
2025-01-22 09:14:37 -08:00
committed by GitHub
parent d19588d87c
commit 115c3be05f
2 changed files with 60 additions and 13 deletions
+46 -6
View File
@@ -73,20 +73,25 @@ See [action.yml](action.yml)
- uses: actions/attest-sbom@v2 - uses: actions/attest-sbom@v2
with: with:
# Path to the artifact serving as the subject of the attestation. Must # Path to the artifact serving as the subject of the attestation. Must
# specify exactly one of "subject-path" or "subject-digest". May contain a # specify exactly one of "subject-path", "subject-digest", or
# glob pattern or list of paths (total subject count cannot exceed 1024). # "subject-checksums". May contain a glob pattern or list of paths
# (total subject count cannot exceed 1024).
subject-path: subject-path:
# SHA256 digest of the subject for the attestation. Must be in the form # SHA256 digest of the subject for the attestation. Must be in the form
# "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one # "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one
# of "subject-path" or "subject-digest". # of "subject-path", "subject-digest", or "subject-checksums".
subject-digest: subject-digest:
# Subject name as it should appear in the attestation. Required unless # Subject name as it should appear in the attestation. Required when
# "subject-path" is specified, in which case it will be inferred from the # identifying the subject with the "subject-digest" input.
# path.
subject-name: subject-name:
# Path to checksums file containing digest and name of subjects for
# attestation. Must specify exactly one of "subject-path", "subject-digest",
# or "subject-checksums".
subject-checksums:
# Path to the JSON-formatted SBOM file to attest. File size cannot exceed # Path to the JSON-formatted SBOM file to attest. File size cannot exceed
# 16MB. # 16MB.
sbom-path: sbom-path:
@@ -203,6 +208,41 @@ newline delimited list:
dist/bar dist/bar
``` ```
### Identify Subjects with Checksums File
If you are using tools like
[goreleaser](https://goreleaser.com/customization/checksum/) or
[jreleaser](https://jreleaser.org/guide/latest/reference/checksum.html) which
generate a checksums file you can identify the attestation subjects by passing
the path of the checksums file to the `subject-checksums` input. Each of the
artifacts identified in the checksums file will be listed as a subject for the
attestation.
```yaml
- name: Calculate artifact digests
run: |
shasum -a 256 foo_0.0.1_* > subject.checksums.txt
- uses: actions/attest-sbom@v2
with:
subject-checksums: subject.checksums.txt
sbom-path: sbom.spdx.json
```
<!-- markdownlint-disable MD038 -->
The file referenced by the `subject-checksums` input must conform to the same
format used by the shasum tools. Each subject should be listed on a separate
line including the hex-encoded digest (either SHA256 or SHA512), a space, a
single character flag indicating either binary (`*`) or text (` `) input mode,
and the filename.
<!-- markdownlint-enable MD038 -->
```text
b569bf992b287f55d78bf8ee476497e9b7e9d2bf1c338860bfb905016218c740 foo_0.0.1_darwin_amd64
a54fc515e616cac7fcf11a49d5c5ec9ec315948a5935c1e11dd610b834b14dde foo_0.0.1_darwin_arm64
```
### Container Image ### Container Image
When working with container images you can invoke the action with the When working with container images you can invoke the action with the
+14 -7
View File
@@ -9,20 +9,26 @@ inputs:
subject-path: subject-path:
description: > description: >
Path to the artifact serving as the subject of the attestation. Must Path to the artifact serving as the subject of the attestation. Must
specify exactly one of "subject-path" or "subject-digest". May contain a specify exactly one of "subject-path", "subject-digest", or
glob pattern or list of paths (total subject count cannot exceed 1024). "subject-checksums". May contain a glob pattern or list of paths (total
subject count cannot exceed 1024).
required: false required: false
subject-digest: subject-digest:
description: > description: >
SHA256 digest of the subject for the attestation. Must be in the form SHA256 digest of the subject for the attestation. Must be in the form
"sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one of "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one of
"subject-path" or "subject-digest". "subject-path", "subject-digest", or "subject-checksums".
required: false required: false
subject-name: subject-name:
description: > description: >
Subject name as it should appear in the attestation. Required unless Subject name as it should appear in the attestation. Required when
"subject-path" is specified, in which case it will be inferred from the identifying the subject with the "subject-digest" input.
path. subject-checksums:
description: >
Path to checksums file containing digest and name of subjects for
attestation. Must specify exactly one of "subject-path", "subject-digest",
or "subject-checksums".
required: false
sbom-path: sbom-path:
description: > description: >
Path to the JSON-formatted SBOM file to attest. File size cannot exceed Path to the JSON-formatted SBOM file to attest. File size cannot exceed
@@ -65,12 +71,13 @@ runs:
id: generate-sbom-predicate id: generate-sbom-predicate
with: with:
sbom-path: ${{ inputs.sbom-path }} sbom-path: ${{ inputs.sbom-path }}
- uses: actions/attest@v2.1.0 - uses: actions/attest@v2.2.0
id: attest id: attest
with: with:
subject-path: ${{ inputs.subject-path }} subject-path: ${{ inputs.subject-path }}
subject-digest: ${{ inputs.subject-digest }} subject-digest: ${{ inputs.subject-digest }}
subject-name: ${{ inputs.subject-name }} subject-name: ${{ inputs.subject-name }}
subject-checksums: ${{ inputs.subject-checksums }}
predicate-type: predicate-type:
${{ steps.generate-sbom-predicate.outputs.predicate-type }} ${{ steps.generate-sbom-predicate.outputs.predicate-type }}
predicate-path: predicate-path: