Skip to content

Commit e5a9546

Browse files
authored
Update cosign on container image creation (#22)
1 parent fde2449 commit e5a9546

3 files changed

Lines changed: 7 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,3 @@ jobs:
1414
markup-lint:
1515
name: Markup
1616
uses: ./.github/workflows/reusable-markup-lint.yml
17-
18-
validate-cosign:
19-
name: Validate / Cosign
20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Clone repository
23-
uses: actions/checkout@v6
24-
- name: Pull Alpine image
25-
run: docker pull ghcr.io/linuxcontainers/alpine:latest
26-
- name: Cosign Alpine image (read-only)
27-
uses: ./actions/cosign/sign
28-
with:
29-
image-name: 'alpine'
30-
image-path: 'ghcr.io/linuxcontainers'
31-
image-tag: 'latest'
32-
readonly: 'true'
33-
permissions:
34-
id-token: write
35-
contents: read

.github/workflows/reusable-container-publication.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ jobs:
108108
ref: ${{ inputs.workflow-parts-version }}
109109
path: workflow-parts
110110
- name: Login to container registry
111-
uses: docker/login-action@v4
111+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee
112112
with:
113113
registry: ${{ inputs.container-registry }}
114114
username: ${{ secrets.container-registry-username }}
115115
password: ${{ secrets.container-registry-password }}
116116
- name: Set up QEMU
117-
uses: docker/setup-qemu-action@v4
117+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3
118118
- name: Set up Buildx
119-
uses: docker/setup-buildx-action@v4
119+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5
120120
- name: Build and push container image
121121
id: build-push
122-
uses: docker/build-push-action@v7
122+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf
123123
with:
124124
context: ${{ inputs.working-directory }}
125125
file: ${{ inputs.image-definition }}

actions/cosign/sign/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ runs:
5656
- name: Get image digest
5757
id: digest
5858
run: |
59-
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ inputs.image-path }}/${{ inputs.image-name }}:${{ inputs.image-tag }} | cut -d'@' -f2)
59+
DIGEST=$(docker buildx imagetools inspect \
60+
${{ inputs.image-path }}/${{ inputs.image-name }}:${{ inputs.image-tag }} \
61+
--format '{{json .Manifest}}' | jq -r '.digest')
6062
echo "DIGEST=$DIGEST" >> $GITHUB_OUTPUT
6163
shell: bash
6264
- name: Sign image with Cosign

0 commit comments

Comments
 (0)