Skip to content

Modern Docker Management, Designed for Everyone

ci/cd: use specific cosign id token

Kyle Mendella5fd68a3f4c9
diff --git a/.depot/workflows/build-next-images.yml b/.depot/workflows/build-next-images.yml
index b7d7eca63..6d2875404 100644
--- a/.depot/workflows/build-next-images.yml
+++ b/.depot/workflows/build-next-images.yml
@@ -80,6 +80,12 @@ jobs:
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
+ - name: Fetch Sigstore identity token
+ run: |
+ RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
+ TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
+ echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
+
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
with:
diff --git a/.github/workflows/build-next-images.yml b/.github/workflows/build-next-images.yml
index 5e5dc98a8..6607ccf81 100644
--- a/.github/workflows/build-next-images.yml
+++ b/.github/workflows/build-next-images.yml
@@ -76,6 +76,12 @@ jobs:
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
+ - name: Fetch Sigstore identity token
+ run: |
+ RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
+ TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
+ echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
+
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
with:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5773730c9..858c7d58e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -71,6 +71,12 @@ jobs:
- name: Install cosign
uses: sigstore/[email protected]
+ - name: Fetch Sigstore identity token
+ run: |
+ RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
+ TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
+ echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
+
- name: Manager image metadata
id: manager-meta
uses: docker/metadata-action@v6
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index 83aff8290..bde5714b4 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -163,6 +163,8 @@ binary_signs:
- "--bundle=${signature}"
- "${artifact}"
- "--yes"
+ env:
+ - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
output: true
signs:
@@ -175,6 +177,8 @@ signs:
- "--bundle=${signature}"
- "${artifact}"
- "--yes"
+ env:
+ - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
output: true
nfpms:
@@ -346,6 +350,8 @@ docker_signs:
- sign
- "${artifact}@${digest}"
- "--yes"
+ env:
+ - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
output: true
blobs: