Skip to content

Modern Docker Management, Designed for Everyone

ci/cd: use specific cosign id token

Kyle Mendell369c7b879ec9
diff --git a/.depot/workflows/build-next-images.yml b/.depot/workflows/build-next-images.yml
index 6d2875404..53ca01b13 100644
--- a/.depot/workflows/build-next-images.yml
+++ b/.depot/workflows/build-next-images.yml
@@ -81,10 +81,11 @@ jobs:
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Fetch Sigstore identity token
+ id: sigstore-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"
+ echo "token=$TOKEN" >> "$GITHUB_OUTPUT"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
@@ -94,6 +95,7 @@ jobs:
args: release --clean --skip=announce,validate,nfpm,homebrew
env:
GITHUB_TOKEN: ${{ secrets.ARCANE_BOT_TOKEN }}
+ SIGSTORE_ID_TOKEN: ${{ steps.sigstore-token.outputs.token }}
BUILD_NEXT: 'true'
SKIP_RELEASE: 'true'
SKIP_CHANGELOG: 'true'
diff --git a/.github/workflows/build-next-images.yml b/.github/workflows/build-next-images.yml
index 6607ccf81..f4895f33f 100644
--- a/.github/workflows/build-next-images.yml
+++ b/.github/workflows/build-next-images.yml
@@ -77,10 +77,11 @@ jobs:
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Fetch Sigstore identity token
+ id: sigstore-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"
+ echo "token=$TOKEN" >> "$GITHUB_OUTPUT"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
@@ -90,6 +91,7 @@ jobs:
args: release --clean --skip=announce,validate,nfpm,homebrew
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SIGSTORE_ID_TOKEN: ${{ steps.sigstore-token.outputs.token }}
BUILD_NEXT: "true"
SKIP_RELEASE: "true"
SKIP_CHANGELOG: "true"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 858c7d58e..5a84fec1f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -72,10 +72,11 @@ jobs:
uses: sigstore/[email protected]
- name: Fetch Sigstore identity token
+ id: sigstore-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"
+ echo "token=$TOKEN" >> "$GITHUB_OUTPUT"
- name: Manager image metadata
id: manager-meta
@@ -186,6 +187,7 @@ jobs:
args: release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.ARCANE_BOT_TOKEN }}
+ SIGSTORE_ID_TOKEN: ${{ steps.sigstore-token.outputs.token }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index bde5714b4..a0543a9e0 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -164,7 +164,7 @@ binary_signs:
- "${artifact}"
- "--yes"
env:
- - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
+ - SIGSTORE_ID_TOKEN={{ index .Env "SIGSTORE_ID_TOKEN" }}
output: true
signs:
@@ -178,7 +178,7 @@ signs:
- "${artifact}"
- "--yes"
env:
- - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
+ - SIGSTORE_ID_TOKEN={{ index .Env "SIGSTORE_ID_TOKEN" }}
output: true
nfpms:
@@ -351,7 +351,7 @@ docker_signs:
- "${artifact}@${digest}"
- "--yes"
env:
- - SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
+ - SIGSTORE_ID_TOKEN={{ index .Env "SIGSTORE_ID_TOKEN" }}
output: true
blobs: