Skip to content

Commit

Permalink
chore: create attest job for the dev container prebuilt image (#2972)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter authored Jan 22, 2025
1 parent a256a0e commit 5cd10f9
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/build-and-push-devcontainer-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
# Write access to `contents` needed to upload SBOM to GitHub's dependency graph.
contents: write
packages: write
attestations: write
env:
# The path to the folder containing the `.devcontainer/` directory.
DEVCONTAINER_WORKSPACE_FOLDER: .github
Expand Down Expand Up @@ -139,16 +138,6 @@ jobs:
fi
done
- name: Attest the provenance of the Docker image build
if: ${{ github.event_name != 'pull_request' }}
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
id: attest
env:
IMAGE: ${{ steps.meta_sha.outputs.tags }}
with:
subject-name: ${{ env.IMAGE }}
subject-digest: ${{ steps.push.outputs.image_digest }}

- name: Generate SBOM for Docker image
uses: anchore/sbom-action@df80a981bc6edbc4e220a492d3cbe9f5547a6e75 # v0.17.9
env:
Expand All @@ -160,6 +149,24 @@ jobs:
upload-artifact: true
dependency-snapshot: ${{ github.event_name != 'pull_request' }}

attest:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
needs: build-and-push
permissions:
# The id-token permission gives the action the ability to mint the OIDC
# token necessary to request a Sigstore signing certificate.
id-token: write
attestations: write
steps:
- name: Attest the provenance of the Docker image build
if: ${{ github.event_name != 'pull_request' }}
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
id: attest
with:
subject-name: ${{ needs.build-and-push.outputs.image }}
subject-digest: ${{ needs.build-and-push.outputs.image_digest }}

cosign:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
Expand Down

0 comments on commit 5cd10f9

Please sign in to comment.