Skip to content

Commit fde88e5

Browse files
committedAug 6, 2024
feat: add subject & digest for provenance attestation
```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 ```
1 parent f8f6f70 commit fde88e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/std/fwlib/blockTypes/containers.nix

+9
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ in
6363
(mkCommand currentSystem "publish" "copy the image to its remote registry" [skopeo-nix2container] ''
6464
${copyFn}
6565
copy docker://${target.image.repo}
66+
67+
# Get the digest of the published image
68+
DIGEST=$(skopeo inspect --raw docker://${target.image.repo}:${builtins.head target.image.tags} | jq -r '.manifests[0].digest')
69+
70+
# Conditionally output the name and digest for GitHub Actions
71+
if [ -n "$GITHUB_OUTPUT" ]; then
72+
echo "name=${target.image.repo}" >> $GITHUB_OUTPUT
73+
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
74+
fi
6675
'' {
6776
meta.image = target.image.name;
6877
inherit proviso;

0 commit comments

Comments
 (0)