Skip to content

Commit

Permalink
feat: add subject & digest for provenance attestation
Browse files Browse the repository at this point in the history
```yaml
  - name: Generate artifact attestation
    uses: actions/attest-build-provenance@v1
    with:
      subject-name: ${{ steps.publish.outputs.name }}
      subject-digest: ${{ steps.publish.outputs.digest }}
      push-to-registry: true
```
  • Loading branch information
blaggacao committed Aug 6, 2024
1 parent f8f6f70 commit 646670e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/std/fwlib/blockTypes/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ in
(mkCommand currentSystem "publish" "copy the image to its remote registry" [skopeo-nix2container] ''
${copyFn}
copy docker://${target.image.repo}
# Get the digest of the published image
DIGEST=$(skopeo inspect --raw docker://${target.image.repo}:${builtins.head target.image.tags} | jq -r '.manifests[0].digest')
# Conditionally output the name and digest for GitHub Actions
if [ -n "$GITHUB_OUTPUT" ]; then
echo "name=${target.image.repo}" >> "$GITHUB_OUTPUT"
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"
fi
'' {
meta.image = target.image.name;
inherit proviso;
Expand Down

0 comments on commit 646670e

Please sign in to comment.