Skip to content

Commit 6575f73

Browse files
authored
merge PR #52 Sign Docker image on release
PR: Sign Docker image on release
2 parents 5783d61 + 9d67d20 commit 6575f73

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/auto-assign-pr.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ on:
77
pull_request:
88
types: [opened]
99

10-
permissions:
11-
contents: read
12-
1310
jobs:
1411
assignAuthor:
15-
permissions:
16-
issues: write # for samspills/assign-pr-to-author
1712
runs-on: ubuntu-latest
1813
steps:
1914

.github/workflows/release-build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
permissions:
4949
contents: read
5050
packages: write
51+
id-token: write # Used for identity challenge with sigstore/fulcio
52+
5153
steps:
5254

5355
- name: Harden Runner
@@ -58,6 +60,14 @@ jobs:
5860
- name: Checkout
5961
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
6062

63+
- name: Install Cosign
64+
uses: sigstore/cosign-installer@c68f43abf1ae5df2528c9c250088fa14ed2d0ef5
65+
with:
66+
cosign-release: 'v1.9.0'
67+
68+
- name: Setup Docker Buildx
69+
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6
70+
6171
- name: Login to GitHub Container Registry
6272
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
6373
with:
@@ -72,9 +82,18 @@ jobs:
7282
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7383

7484
- name: Build + Push Docker image
85+
id: build-and-push
7586
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
7687
with:
7788
context: .
7889
push: true
7990
tags: ${{ steps.meta.outputs.tags }}
8091
labels: ${{ steps.meta.outputs.labels }}
92+
93+
# Sign the Docker image digest
94+
# Uses the identity token to provision an ephemeral certificate against the community Fulcio instance
95+
# https://github.com/sigstore/cosign
96+
- name: Sign the Docker image
97+
env:
98+
COSIGN_EXPERIMENTAL: "true"
99+
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

0 commit comments

Comments
 (0)