@@ -40,27 +40,27 @@ jobs:
4040
4141 steps :
4242 - name : Checkout repository
43- uses : actions/checkout@v6
43+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
4444
4545 # Install the cosign tool except on PR
4646 # https://github.com/sigstore/cosign-installer
4747 - name : Install cosign
4848 if : github.event_name != 'pull_request'
4949 uses : sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
5050 with :
51- cosign-release : " v2.2.4 "
51+ cosign-release : " v3.1.3 "
5252
5353 # Set up BuildKit Docker container builder to be able to build
5454 # multi-platform images and export cache
5555 # https://github.com/docker/setup-buildx-action
5656 - name : Set up Docker Buildx
57- uses : docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
57+ uses : docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
5858
5959 # Login against a Docker registry except on PR
6060 # https://github.com/docker/login-action
6161 - name : Log into registry ${{ env.REGISTRY }}
6262 if : github.event_name != 'pull_request'
63- uses : docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2 .0
63+ uses : docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6 .0
6464 with :
6565 registry : ${{ env.REGISTRY }}
6666 username : ${{ github.actor }}
7070 # https://github.com/docker/metadata-action
7171 - name : Extract Docker metadata
7272 id : meta
73- uses : docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1 .0
73+ uses : docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2 .0
7474 with :
7575 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7676 tags : |
8787 type=raw,value=latest,enable=${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
8888
8989 - name : Go Build Cache for Docker
90- uses : actions/cache@v5
90+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
9191 with :
9292 path : go-build-cache
9393 key : ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
@@ -106,7 +106,7 @@ jobs:
106106 # https://github.com/docker/build-push-action
107107 - name : Build and push Docker image
108108 id : build-and-push
109- uses : docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2 .0
109+ uses : docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4 .0
110110 with :
111111 context : .
112112 push : ${{ github.event_name != 'pull_request' }}
@@ -116,20 +116,26 @@ jobs:
116116 cache-to : type=gha,mode=max
117117 platforms : linux/amd64,linux/arm64
118118 build-args : |
119- VERSION=${{ github.ref_name }}
119+ VERSION=${{ github.ref_type == 'tag' && github.ref_name || 'dev' }}
120+ secrets : |
121+ oauth_client_id=${{ secrets.OAUTH_CLIENT_ID }}
122+ oauth_client_secret=${{ secrets.OAUTH_CLIENT_SECRET }}
120123
121124 # Sign the resulting Docker image digest except on PRs.
122- # This will only write to the public Rekor transparency log when the Docker
123- # repository is public to avoid leaking data. If you would like to publish
124- # transparency data even for private images, pass --force to cosign below.
125+ # Publish both v2-compatible .sig tags and native Sigstore bundles.
126+ # --yes also consents to publishing signing metadata to the public log.
125127 # https://github.com/sigstore/cosign
126- - name : Sign the published Docker image
128+ - name : Sign the published Docker image (legacy)
127129 if : ${{ github.event_name != 'pull_request' }}
128130 env :
129131 # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
130- TAGS : ${{ steps.meta.outputs.tags }}
131132 DIGEST : ${{ steps.build-and-push.outputs.digest }}
132133 # This step uses the identity token to provision an ephemeral certificate
133134 # against the sigstore community Fulcio instance.
134- run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
135-
135+ run : cosign sign --yes --new-bundle-format=false --use-signing-config=false --registry-referrers-mode=legacy "${REGISTRY}/${IMAGE_NAME}@${DIGEST}"
136+
137+ - name : Sign the published Docker image (native bundle)
138+ if : ${{ github.event_name != 'pull_request' }}
139+ env :
140+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
141+ run : cosign sign --yes "${REGISTRY}/${IMAGE_NAME}@${DIGEST}"
0 commit comments