Skip to content

Commit a5fd68a

Browse files
committed
ci/cd: use specific cosign id token
1 parent 0e853be commit a5fd68a

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.depot/workflows/build-next-images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ jobs:
8080
run: |
8181
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
8282
83+
- name: Fetch Sigstore identity token
84+
run: |
85+
RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
86+
TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
87+
echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
88+
8389
- name: Run GoReleaser
8490
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
8591
with:

.github/workflows/build-next-images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ jobs:
7676
run: |
7777
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
7878
79+
- name: Fetch Sigstore identity token
80+
run: |
81+
RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
82+
TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
83+
echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
84+
7985
- name: Run GoReleaser
8086
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 #v7.0.0
8187
with:

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ jobs:
7171
- name: Install cosign
7272
uses: sigstore/cosign-installer@v4.1.1
7373

74+
- name: Fetch Sigstore identity token
75+
run: |
76+
RESPONSE="$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sigstore")"
77+
TOKEN="$(jq -r '.value' <<<"$RESPONSE")"
78+
echo "SIGSTORE_ID_TOKEN=$TOKEN" >> "$GITHUB_ENV"
79+
7480
- name: Manager image metadata
7581
id: manager-meta
7682
uses: docker/metadata-action@v6

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ binary_signs:
163163
- "--bundle=${signature}"
164164
- "${artifact}"
165165
- "--yes"
166+
env:
167+
- SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
166168
output: true
167169

168170
signs:
@@ -175,6 +177,8 @@ signs:
175177
- "--bundle=${signature}"
176178
- "${artifact}"
177179
- "--yes"
180+
env:
181+
- SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
178182
output: true
179183

180184
nfpms:
@@ -346,6 +350,8 @@ docker_signs:
346350
- sign
347351
- "${artifact}@${digest}"
348352
- "--yes"
353+
env:
354+
- SIGSTORE_ID_TOKEN={{ .Env.SIGSTORE_ID_TOKEN }}
349355
output: true
350356

351357
blobs:

0 commit comments

Comments
 (0)