From a6b9f4749d0d2e81c11ece544113816b8cf6ea41 Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 23 Nov 2025 02:40:09 +0700 Subject: [PATCH 1/2] Create build-attested-image.yml Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- .github/workflows/build-attested-image.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-attested-image.yml diff --git a/.github/workflows/build-attested-image.yml b/.github/workflows/build-attested-image.yml new file mode 100644 index 00000000000..4f3eefb7993 --- /dev/null +++ b/.github/workflows/build-attested-image.yml @@ -0,0 +1,42 @@ +name: build-attested-image + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + id-token: write + packages: write + contents: read + attestations: write + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push image + id: push + uses: docker/build-push-action@v5.0.0 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + - name: Attest + uses: actions/attest-build-provenance@v1 + id: attest + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + From a6195d179460fa31a80add8852a969c2d18ebef6 Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 23 Nov 2025 02:56:57 +0700 Subject: [PATCH 2/2] Update .github/workflows/build-attested-image.yml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- .github/workflows/build-attested-image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-attested-image.yml b/.github/workflows/build-attested-image.yml index 4f3eefb7993..bf8d47ffe62 100644 --- a/.github/workflows/build-attested-image.yml +++ b/.github/workflows/build-attested-image.yml @@ -31,7 +31,9 @@ jobs: with: context: . push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} - name: Attest uses: actions/attest-build-provenance@v1 id: attest