|
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | 8 |
|
| 9 | +# Add permissions needed for GitHub Container Registry |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + packages: write |
| 13 | + id-token: write # Needed for OIDC token issuance for attestation |
| 14 | + |
9 | 15 | jobs: |
10 | 16 | build: |
11 | 17 | runs-on: ubuntu-latest |
|
25 | 31 | id: image_names |
26 | 32 | run: | |
27 | 33 | DOCKERHUB_IMAGE="evandarwin/lua" |
| 34 | + # Convert GitHub repository owner to lowercase using tr |
28 | 35 | OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') |
29 | 36 | GHCR_IMAGE="ghcr.io/${OWNER}/lua" |
30 | | - |
31 | 37 | echo "dockerhub_image=$DOCKERHUB_IMAGE" >> $GITHUB_OUTPUT |
32 | 38 | echo "ghcr_image=$GHCR_IMAGE" >> $GITHUB_OUTPUT |
33 | 39 | |
@@ -81,15 +87,17 @@ jobs: |
81 | 87 | ${{ steps.image_names.outputs.ghcr_image }}:${{ steps.version.outputs.major_minor_version }} |
82 | 88 | ${{ steps.image_names.outputs.ghcr_image }}:${{ steps.version.outputs.major_version }} |
83 | 89 | ${{ matrix.lua-version == '5.4.7' && format('{0}:latest', steps.image_names.outputs.ghcr_image) || '' }} |
84 | | - provenance: true |
85 | | - outputs: type=image,name=${{ steps.image_names.outputs.dockerhub_image }}:${{ steps.version.outputs.full_version }} |
| 90 | + # Enable provenance attestation for both registries |
| 91 | + provenance: mode=max |
| 92 | + outputs: | |
| 93 | + type=image,name=${{ steps.image_names.outputs.dockerhub_image }}:${{ steps.version.outputs.full_version }} |
86 | 94 | build-args: | |
87 | 95 | BUILD_DATE=${{ github.event.repository.updated_at }} |
88 | 96 | VCS_REF=${{ github.sha }} |
89 | 97 | LUA_VERSION=${{ matrix.lua-version }} |
90 | 98 | LUAROCKS_VERSION=${{ matrix.luarocks-version }} |
91 | 99 | |
92 | | - - name: Generate artifact attestation |
| 100 | + - name: Generate artifact attestation for Docker Hub |
93 | 101 | uses: actions/attest-build-provenance@v2 |
94 | 102 | with: |
95 | 103 | subject-name: index.docker.io/${{ steps.image_names.outputs.dockerhub_image }} |
|
0 commit comments