@@ -317,7 +317,7 @@ jobs:
317317
318318 publish :
319319 name : Publish reviewed distribution
320- needs : [build, smoke, provenance]
320+ needs : [build, smoke, provenance, verify_attestations ]
321321 if : ${{ (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch' }}
322322 runs-on : ubuntu-latest
323323 timeout-minutes : 10
@@ -381,9 +381,46 @@ jobs:
381381 subject-checksums : dist/SHA256SUMS
382382 sbom-path : dist/SBOM.spdx.json
383383
384+ verify_attestations :
385+ name : Verify reviewed release attestations
386+ needs : [build, smoke, provenance, attest]
387+ if : ${{ (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch' }}
388+ runs-on : ubuntu-latest
389+ timeout-minutes : 10
390+ permissions :
391+ contents : read
392+ attestations : read
393+ steps :
394+ - name : Download reviewed distributions
395+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
396+ with :
397+ name : base-cli-dist-${{ github.run_id }}
398+ path : dist
399+
400+ - name : Verify artifact provenance and SBOM attestations
401+ env :
402+ SOURCE_COMMIT : ${{ needs.build.outputs.source_commit }}
403+ RELEASE_TAG : ${{ needs.build.outputs.release_tag }}
404+ GH_TOKEN : ${{ github.token }}
405+ run : |
406+ set -euo pipefail
407+ for asset in dist/*.whl dist/*.tar.gz; do
408+ gh attestation verify "$asset" \
409+ --repo "$GITHUB_REPOSITORY" \
410+ --signer-workflow "github.com/$GITHUB_REPOSITORY/.github/workflows/package.yml" \
411+ --source-digest "$SOURCE_COMMIT" \
412+ --source-ref "refs/tags/$RELEASE_TAG"
413+ gh attestation verify "$asset" \
414+ --repo "$GITHUB_REPOSITORY" \
415+ --signer-workflow "github.com/$GITHUB_REPOSITORY/.github/workflows/package.yml" \
416+ --source-digest "$SOURCE_COMMIT" \
417+ --source-ref "refs/tags/$RELEASE_TAG" \
418+ --predicate-type "https://spdx.dev/Document"
419+ done
420+
384421 verify_pypi :
385422 name : Verify published PyPI metadata
386- needs : [build, publish, attest ]
423+ needs : [build, publish, verify_attestations ]
387424 if : ${{ (github.event_name == 'push' && github.ref_type == 'tag') || (github.event_name == 'workflow_dispatch' && inputs.publish_target == 'pypi' && inputs.release_tag != '') }}
388425 runs-on : ubuntu-latest
389426 timeout-minutes : 5
@@ -405,7 +442,7 @@ jobs:
405442
406443 release :
407444 name : Create GitHub Release
408- needs : [build, smoke, provenance, publish, attest , verify_pypi]
445+ needs : [build, smoke, provenance, attest, verify_attestations, publish , verify_pypi]
409446 if : ${{ (github.event_name == 'push' && github.ref_type == 'tag') || (github.event_name == 'workflow_dispatch' && inputs.publish_target == 'pypi' && inputs.release_tag != '') }}
410447 runs-on : ubuntu-latest
411448 timeout-minutes : 10
@@ -442,6 +479,7 @@ jobs:
442479 SOURCE_REVISION : ${{ needs.build.outputs.source_commit }}
443480 RELEASE_TAG : ${{ needs.build.outputs.release_tag }}
444481 SOURCE_COMMIT : ${{ needs.build.outputs.source_commit }}
482+ SOURCE_REF : refs/tags/${{ needs.build.outputs.release_tag }}
445483 run : |
446484 set -euo pipefail
447485 tag="$RELEASE_TAG"
@@ -458,13 +496,13 @@ jobs:
458496 gh attestation verify "$asset" \
459497 --repo "$GITHUB_REPOSITORY" \
460498 --signer-workflow "github.com/$GITHUB_REPOSITORY/.github/workflows/package.yml" \
461- --source-digest "$GITHUB_SHA " \
462- --source-ref "$GITHUB_REF "
499+ --source-digest "$SOURCE_COMMIT " \
500+ --source-ref "$SOURCE_REF "
463501 gh attestation verify "$asset" \
464502 --repo "$GITHUB_REPOSITORY" \
465503 --signer-workflow "github.com/$GITHUB_REPOSITORY/.github/workflows/package.yml" \
466- --source-digest "$GITHUB_SHA " \
467- --source-ref "$GITHUB_REF " \
504+ --source-digest "$SOURCE_COMMIT " \
505+ --source-ref "$SOURCE_REF " \
468506 --predicate-type "https://spdx.dev/Document"
469507 done
470508
0 commit comments