Skip to content

Commit 92477c1

Browse files
guguclaude
andcommitted
ci: sign published images with cosign keyless
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 60bd802 commit 92477c1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
permissions:
1515
contents: read
1616
packages: write
17+
id-token: write
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v4
@@ -91,6 +92,7 @@ jobs:
9192
username: ${{ github.actor }}
9293
password: ${{ github.token }}
9394
- name: Build and Push
95+
id: build
9496
uses: docker/build-push-action@v6
9597
with:
9698
context: .
@@ -106,3 +108,14 @@ jobs:
106108
TIMESCALE_TOOLKIT_VERSION=${{ steps.versions.outputs.timescale_toolkit }}
107109
cache-from: type=gha
108110
cache-to: type=gha,mode=max
111+
- name: Install Cosign
112+
if: github.ref_name == 'main'
113+
uses: sigstore/cosign-installer@v3
114+
- name: Sign image with Cosign
115+
if: github.ref_name == 'main'
116+
env:
117+
TAGS: ${{ steps.meta.outputs.tags }}
118+
DIGEST: ${{ steps.build.outputs.digest }}
119+
run: |
120+
set -euo pipefail
121+
printf '%s\n' "$TAGS" | xargs -I {} cosign sign --yes "{}@${DIGEST}"

0 commit comments

Comments
 (0)