Skip to content

Commit

Permalink
feat(release): attest (#15)
Browse files Browse the repository at this point in the history
* feat(release): attest

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

* fix(autotag/release): use permissions

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

* fix(autotag): contents - write

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

* fix(release): only if tag

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

---------

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>
  • Loading branch information
eyenx authored Oct 31, 2024
1 parent 06cb5b0 commit 1ace9ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/autotag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -16,5 +18,5 @@ jobs:
id: semrel
uses: go-semantic-release/action@v1.21
with:
github-token: ${{ secrets.PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
allow-initial-development-versions: true
16 changes: 15 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
jobs:
build-container:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: read
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -37,7 +42,7 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: redhat-actions/buildah-build@v2
Expand All @@ -64,3 +69,12 @@ jobs:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io/eyenx

- name: Attest
uses: actions/attest-build-provenance@v1
if: startsWith(github.ref, 'refs/tags/v')
id: attest
with:
subject-name: ghcr.io/eyenx/blog
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 1ace9ec

Please sign in to comment.