diff --git a/.github/workflows/build-image-test.yaml b/.github/workflows/build-image-test.yaml index f13091229..6e9c16a74 100644 --- a/.github/workflows/build-image-test.yaml +++ b/.github/workflows/build-image-test.yaml @@ -32,6 +32,13 @@ jobs: .github/workflows/build-image-test.yaml tools/*.sh + - name: Set IMAGE environment variable + # Lowercase the repo name for make able to run workflow in forks, + # which owners have uppercase letters in nickname + run: >- + echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}:${{ env.IMAGE_TAG }}" + >> $GITHUB_ENV + - name: Set up QEMU if: matrix.os != 'ubuntu-latest' || matrix.arch != 'amd64' # yamllint disable-line rule:line-length @@ -56,8 +63,7 @@ jobs: linux/${{ matrix.arch }} push: false load: true - tags: | - ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} + tags: ${{ env.IMAGE }} # Fix multi-platform: https://github.com/docker/buildx/issues/1533 provenance: false secrets: | @@ -68,7 +74,7 @@ jobs: # yamllint disable-line rule:line-length uses: plexsystems/container-structure-test-action@c0a028aa96e8e82ae35be556040340cbb3e280ca # v0.3.0 with: - image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} + image: ${{ env.IMAGE }} config: .github/.container-structure-test-config.yaml - name: Dive - check image for waste files @@ -76,7 +82,7 @@ jobs: # yamllint disable-line rule:line-length uses: MaxymVlasov/dive-action@379af3fc636888ada5899c997e8b52db6ad45023 # v1.0.1 with: - image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} + image: ${{ env.IMAGE }} config-file: ${{ github.workspace }}/.github/.dive-ci.yaml github-token: ${{ secrets.GITHUB_TOKEN }} @@ -95,8 +101,7 @@ jobs: INSTALL_ALL=true platforms: linux/amd64,linux/arm64 push: false - tags: | - ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} + tags: ${{ env.IMAGE }} # Fix multi-platform: https://github.com/docker/buildx/issues/1533 provenance: false secrets: | diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 8abff277c..974ffdd33 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -37,6 +37,12 @@ jobs: || echo 'latest' ) >> $GITHUB_ENV + - name: Set IMAGE_REPO environment variable + # Lowercase the repo name for make able to run workflow in forks, + # which owners have uppercase letters in nickname + run: >- + echo "IMAGE_REPO=ghcr.io/${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV + - name: Set up Docker Buildx # yamllint disable-line rule:line-length uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 @@ -52,8 +58,8 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} - ghcr.io/${{ github.repository }}:latest + ${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }} + ${{ env.IMAGE_REPO }}:latest # Fix multi-platform: https://github.com/docker/buildx/issues/1533 provenance: false secrets: | @@ -70,7 +76,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/${{ github.repository }}:nightly + ${{ env.IMAGE_REPO }}:nightly # Fix multi-platform: https://github.com/docker/buildx/issues/1533 provenance: false secrets: |