@@ -33,26 +33,27 @@ jobs:
33
33
34
34
steps :
35
35
- name : Checkout repository
36
- uses : actions/checkout@v3
36
+ uses : actions/checkout@v4
37
37
38
38
# Install the cosign tool except on PR
39
39
# https://github.com/sigstore/cosign-installer
40
40
- name : Install cosign
41
41
if : github.event_name != 'pull_request'
42
- uses :
sigstore/[email protected] # v2.6.0
43
- # with:
44
- # cosign-release: 'v1.11.0'
45
-
42
+ uses : sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1
43
+ with :
44
+ cosign-release : ' v2.1.1'
46
45
47
- # Workaround: https://github.com/docker/build-push-action/issues/461
48
- - name : Setup Docker buildx
49
- uses : docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
46
+ # Set up BuildKit Docker container builder to be able to build
47
+ # multi-platform images and export cache
48
+ # https://github.com/docker/setup-buildx-action
49
+ - name : Set up Docker Buildx
50
+ uses : docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
50
51
51
52
# Login against a Docker registry except on PR
52
53
# https://github.com/docker/login-action
53
54
- name : Log into registry ${{ env.REGISTRY }}
54
55
if : github.event_name != 'pull_request'
55
- uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
56
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
56
57
with :
57
58
registry : ${{ env.REGISTRY }}
58
59
username : ${{ github.actor }}
@@ -62,15 +63,15 @@ jobs:
62
63
# https://github.com/docker/metadata-action
63
64
- name : Extract Docker metadata
64
65
id : meta
65
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
66
+ uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
66
67
with :
67
68
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68
69
69
70
# Build and push Docker image with Buildx (don't push on PR)
70
71
# https://github.com/docker/build-push-action
71
72
- name : Build and push Docker image
72
73
id : build-and-push
73
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
74
+ uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
74
75
with :
75
76
context : .
76
77
push : ${{ github.event_name != 'pull_request' }}
79
80
cache-from : type=gha
80
81
cache-to : type=gha,mode=max
81
82
82
-
83
83
# Sign the resulting Docker image digest except on PRs.
84
84
# This will only write to the public Rekor transparency log when the Docker
85
85
# repository is public to avoid leaking data. If you would like to publish
88
88
- name : Sign the published Docker image
89
89
if : ${{ github.event_name != 'pull_request' }}
90
90
env :
91
- COSIGN_EXPERIMENTAL : " true"
91
+ # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
92
+ TAGS : ${{ steps.meta.outputs.tags }}
93
+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
92
94
# This step uses the identity token to provision an ephemeral certificate
93
95
# against the sigstore community Fulcio instance.
94
- run : echo "${{ steps.meta.outputs.tags }} " | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest } }
96
+ run : echo "${TAGS} " | xargs -I {} cosign sign --yes {}@${DIGEST }
0 commit comments