Skip to content

Commit

Permalink
retry prime provenance
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Newberry <[email protected]>
  • Loading branch information
brooksn committed Dec 11, 2024
1 parent 1ddf5ae commit 2748929
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions actions/publish-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,23 @@ runs:

- name: Attest provenance
shell: bash
run: |
if slsactl download provenance --format=slsav1 "${IMG_NAME}" > provenance-slsav1.json; then
cat provenance-slsav1.json
cosign attest --yes --predicate provenance-slsav1.json --type slsaprovenance1 "${IMG_NAME}"
else
slsactl download provenance --format=slsav1 "${IMG_NAME}"
echo "ERROR: Failed to generate slsav1 provenance. Check whether the image is present in the Prime registry."
exit 3
fi
if: ${{ inputs.push-to-prime == true || inputs.push-to-prime == 'true' }}
run: |
max_retries=3
retry_delay=5
i=0
while [ $i -lt $max_retries ]; do
if slsactl download provenance --format=slsav1 "${IMG_NAME}" > provenance.json; then
break
fi
if [ $i -eq $(( max_retries - 1 )) ]; then
echo "ERROR: Failed to generate slsav1 provenance. Check whether the image is present in the Prime registry."
exit 1
fi
i=$(( i + 1 ))
sleep $retry_delay
done
cat provenance-slsav1.json
cosign attest --yes --predicate provenance.json --type slsaprovenance1 "${IMG_NAME}"

0 comments on commit 2748929

Please sign in to comment.