From 70bb99b3d02020e695476598c7d1360ec8c17075 Mon Sep 17 00:00:00 2001 From: gkhaavik Date: Wed, 9 Jul 2025 00:59:08 +0200 Subject: [PATCH] feat: Update Docker image name to use repository variable and streamline login credentials --- .github/workflows/release.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1bb866..ca60d46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: zenfulcode/commercifygo + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push: @@ -14,8 +14,6 @@ jobs: permissions: contents: read packages: write - attestations: write - id-token: write steps: - name: Checkout repository @@ -28,22 +26,18 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }} - - name: Debug repository info + - name: Convert repository name to lowercase run: | - echo "Repository: ${{ github.repository }}" - echo "Repository owner: ${{ github.repository_owner }}" - echo "Image name: ${{ env.IMAGE_NAME }}" - echo "Registry: ${{ env.REGISTRY }}" - echo "Full image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" + echo "IMAGE_NAME_LOWER=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }} tags: | type=ref,event=tag type=semver,pattern={{version}}