From 6d78e3b4cb6e4a5bc91e290ed81071a8a9dc992f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Wed, 27 Nov 2024 15:27:16 +0100 Subject: [PATCH] fixup! Use Docker login action --- .github/workflows/release-container-image.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-container-image.yml b/.github/workflows/release-container-image.yml index bbb5c55..626bbf4 100644 --- a/.github/workflows/release-container-image.yml +++ b/.github/workflows/release-container-image.yml @@ -12,12 +12,12 @@ on: permissions: id-token: write + packages: write contents: read attestations: write - packages: write env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + REGISTRY: ghcr.io/${{ github.repository_owner }} REGISTRY_USER: ${{ github.actor }} REGISTRY_PASSWORD: ${{ github.token }} IMAGE_NAME: dangerzone/dangerzone @@ -27,6 +27,12 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: USERNAME + password: ${{ github.token }} - name: Build and push the dangerzone image id: build-image @@ -37,7 +43,7 @@ jobs: gunzip -c share/container.tar.gz | podman load podman push \ dangerzone.rocks/dangerzone \ - ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} DIGEST=$(podman images --filter "reference=dangerzone.rocks/dangerzone" --format "{{ .Digest }}") echo "Digest: ${DIGEST}" echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT" @@ -45,6 +51,6 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: - subject-name: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} subject-digest: "${{ steps.build-image.outputs.digest }}" push-to-registry: true