From d0189b055660a296702abb794f290ad8d3313e03 Mon Sep 17 00:00:00 2001 From: "m.nabokikh" Date: Wed, 10 Jan 2024 20:32:37 +0100 Subject: [PATCH] Sign container images Signed-off-by: m.nabokikh --- .github/workflows/artifacts.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/artifacts.yaml b/.github/workflows/artifacts.yaml index 5c3d9ba8..3faed983 100644 --- a/.github/workflows/artifacts.yaml +++ b/.github/workflows/artifacts.yaml @@ -62,6 +62,11 @@ jobs: - name: Set up Syft uses: anchore/sbom-action/download-syft@c7f031d9249a826a082ea14c79d3b686a51d485a # v0.15.3 + - name: Install cosign + uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0 + with: + cosign-release: 'v2.2.1' + - name: Set image name id: image-name run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT" @@ -130,6 +135,11 @@ jobs: outputs: ${{ steps.build-output.outputs.value }} # push: ${{ inputs.publish }} + - name: Sign the images with GitHub OIDC Token + run: | + cosign sign --yes ${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }} + if: inputs.publish + - name: Set image ref id: image-ref run: echo "value=${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"