Skip to content

Commit 00014ed

Browse files
authored
Add support for creating artifact metadata storage records (#779)
* use latest version of attest action Signed-off-by: Meredith Lancaster <malancas@github.com> * include docs on create-storage-record Signed-off-by: Meredith Lancaster <malancas@github.com> * install most recent version of actions/attest Signed-off-by: Meredith Lancaster <malancas@github.com> * update attest action to latest version Signed-off-by: Meredith Lancaster <malancas@github.com> * add artifact-metadata permission docs Signed-off-by: Meredith Lancaster <malancas@github.com> * restore original package version Signed-off-by: Meredith Lancaster <malancas@github.com> --------- Signed-off-by: Meredith Lancaster <malancas@github.com>
1 parent 8835c60 commit 00014ed

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ attest:
4646
permissions:
4747
id-token: write
4848
attestations: write
49+
artifact-metadata: write
4950
```
5051
5152
The `id-token` permission gives the action the ability to mint the OIDC token
5253
necessary to request a Sigstore signing certificate. The `attestations`
5354
permission is necessary to persist the attestation.
55+
The `artifact-metadata` permission is required to generate artifact
56+
metadata storage records. If this permission is not included, the action
57+
will continue without creating the record.
5458

5559
1. Add the following to your workflow after your artifact has been built:
5660

@@ -95,6 +99,12 @@ See [action.yml](action.yml)
9599
# the "subject-digest" parameter be specified. Defaults to false.
96100
push-to-registry:
97101
102+
# Whether to create a storage record for the artifact.
103+
# Requires that push-to-registry is set to true.
104+
# Requires that the "subject-name" parameter specify the fully-qualified
105+
# image name. Defaults to true.
106+
create-storage-record:
107+
98108
# Whether to attach a list of generated attestations to the workflow run
99109
# summary page. Defaults to true.
100110
show-summary:
@@ -243,6 +253,10 @@ the specific image being attested is identified by the supplied digest.
243253
Attestation bundles are stored in the OCI registry according to the [Cosign
244254
Bundle Specification][10].
245255

256+
If the `push-to-registry` option is set to true, the Action will also
257+
emit an Artifact Metadata Storage Record. If you do not want to emit a
258+
storage record, set `create-storage-record` to `false`.
259+
246260
> **NOTE**: When pushing to Docker Hub, please use "index.docker.io" as the
247261
> registry portion of the image name.
248262

action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ inputs:
3636
and that the "subject-digest" parameter be specified. Defaults to false.
3737
default: false
3838
required: false
39+
create-storage-record:
40+
description: >
41+
Whether to create a storage record for the artifact.
42+
Requires that push-to-registry is set to true. Defaults to true.
43+
default: true
44+
required: false
3945
show-summary:
4046
description: >
4147
Whether to attach a list of generated attestations to the workflow run
@@ -64,7 +70,7 @@ runs:
6470
steps:
6571
- uses: actions/attest-build-provenance/predicate@864457a58d4733d7f1574bd8821fa24e02cf7538 # predicate@2.0.0
6672
id: generate-build-provenance-predicate
67-
- uses: actions/attest@daf44fb950173508f38bd2406030372c1d1162b1 # v3.0.0
73+
- uses: actions/attest@7667f588f2f73a90cea6c7ac70e78266c4f76616 # v3.1.0
6874
id: attest
6975
env:
7076
NODE_OPTIONS: "--max-http-header-size=32768"
@@ -76,5 +82,6 @@ runs:
7682
predicate-type: ${{ steps.generate-build-provenance-predicate.outputs.predicate-type }}
7783
predicate: ${{ steps.generate-build-provenance-predicate.outputs.predicate }}
7884
push-to-registry: ${{ inputs.push-to-registry }}
85+
create-storage-record: ${{ inputs.create-storage-record }}
7986
show-summary: ${{ inputs.show-summary }}
8087
github-token: ${{ inputs.github-token }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)