Skip to content

Commit f19920a

Browse files
SRE-2916: Publish build attestation to GH. (#43)
1 parent cb0e44d commit f19920a

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/actions/push/action.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ inputs:
1616
required: false
1717
type: string
1818

19+
outputs:
20+
digest:
21+
description: "The digest of the built image"
22+
value: ${{ steps.build.outputs.digest }}
23+
1924
runs:
2025
using: "composite"
2126
steps:
@@ -67,6 +72,7 @@ runs:
6772
endpoint: builders
6873

6974
- name: Build and push
75+
id: build
7076
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # pin@v6.15.0
7177
with:
7278
context: .

.github/workflows/main.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
push:
1111
name: Push Docker
1212
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
attestations: write
16+
packages: write
1317
steps:
1418
- name: Checkout
1519
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4.2.2
@@ -23,6 +27,15 @@ jobs:
2327
echo TAGS="ghcr.io/${{ github.repository }}/immutable-geth:unstable-$BUILD_TIMESTAMP-git.$SHORT_SHA" >> $GITHUB_ENV
2428
2529
- uses: ./.github/actions/push
30+
id: push
2631
with:
2732
github-token: ${{ secrets.GITHUB_TOKEN }}
2833
tags: ${{ env.TAGS }}
34+
35+
- name: Attest
36+
uses: actions/attest-build-provenance@v2
37+
id: attest
38+
with:
39+
subject-name: ghcr.io/${{ github.repository }}/immutable-geth
40+
subject-digest: ${{ steps.push.outputs.digest }}
41+
push-to-registry: false

.github/workflows/release.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
push:
99
name: Push Docker
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
attestations: write
14+
packages: write
1115
steps:
1216
- name: Checkout
1317
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4.2.2
@@ -16,6 +20,15 @@ jobs:
1620
run: echo "TAG=$(echo ${GITHUB_REF} | sed 's/refs\/tags\///')" >> $GITHUB_ENV
1721

1822
- uses: ./.github/actions/push
23+
id: push
1924
with:
2025
github-token: ${{ secrets.GITHUB_TOKEN }}
2126
tags: "ghcr.io/${{ github.repository }}/immutable-geth:latest,ghcr.io/${{ github.repository }}/immutable-geth:${{ env.TAG }}"
27+
28+
- name: Attest
29+
uses: actions/attest-build-provenance@v2
30+
id: attest
31+
with:
32+
subject-name: ghcr.io/${{ github.repository }}/immutable-geth
33+
subject-digest: ${{ steps.push.outputs.digest }}
34+
push-to-registry: false

0 commit comments

Comments
 (0)