Skip to content

Commit 1d13325

Browse files
haasonsaasclaude
andauthored
Add cosign keyless signing to Docker image release (#5)
Signs the container image after push using Sigstore keyless signing (GitHub Actions OIDC). This enables Kyverno signature verification in the homelab-k8s cluster. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 13d787e commit 1d13325

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
permissions:
1212
contents: write
1313
packages: write
14+
id-token: write
1415

1516
jobs:
1617
create-release:
@@ -229,6 +230,7 @@ jobs:
229230
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
230231

231232
- name: Build and push Docker image
233+
id: build-and-push
232234
uses: docker/build-push-action@v6
233235
with:
234236
context: .
@@ -240,5 +242,10 @@ jobs:
240242
ghcr.io/haasonsaas/diffscope:latest
241243
ghcr.io/haasonsaas/diffscope:${{ steps.get_version.outputs.VERSION }}
242244
243-
# Homebrew formula update can be added later when tap repository is created
244-
# For now, users can use the install script or download binaries directly
245+
- name: Install cosign
246+
uses: sigstore/cosign-installer@v3
247+
248+
- name: Sign image (keyless)
249+
env:
250+
IMAGE_REF: ghcr.io/haasonsaas/diffscope@${{ steps.build-and-push.outputs.digest }}
251+
run: cosign sign --yes "${IMAGE_REF}"

0 commit comments

Comments
 (0)