From f86fd19e352b1350bf3f60b32c37835103594b17 Mon Sep 17 00:00:00 2001 From: romeroalx Date: Wed, 22 Nov 2023 10:50:02 +0100 Subject: [PATCH 1/2] make sure image-id is in lowercase --- .github/workflows/build-debian-images.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-debian-images.yaml b/.github/workflows/build-debian-images.yaml index abf62fe..c7efd05 100644 --- a/.github/workflows/build-debian-images.yaml +++ b/.github/workflows/build-debian-images.yaml @@ -25,10 +25,13 @@ jobs: steps: - uses: actions/checkout@v3 + - run: | + echo "image-id-lowercase=ghcr.io/${{ github.repository }}/${{ matrix.image-id }}" | tr '[:upper:]' '[:lower:]' >> "$GITHUB_ENV" + - name: Build image run: | docker build . --file Dockerfile \ - --tag ghcr.io/${{ github.repository }}/${{ matrix.image-id }}:${{ env.IMAGE_TAG }} \ + --tag ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }} \ --build-arg DEBIAN_IMAGE_TAG=${{ matrix.debian-release-name }} - name: Login to GitHub Container Registry @@ -40,4 +43,4 @@ jobs: - name: Push into Github Container Registry run: | - docker push ghcr.io/${{ github.repository }}/${{ matrix.image-id }}:${{ env.IMAGE_TAG }} + docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }} From 077e21ddbd4ac3724f3aa31f8dc6c20db363959b Mon Sep 17 00:00:00 2001 From: romeroalx Date: Wed, 22 Nov 2023 11:00:23 +0100 Subject: [PATCH 2/2] validate repo on pull_request without pushing images --- .github/workflows/build-debian-images.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-debian-images.yaml b/.github/workflows/build-debian-images.yaml index c7efd05..a1a4713 100644 --- a/.github/workflows/build-debian-images.yaml +++ b/.github/workflows/build-debian-images.yaml @@ -3,6 +3,7 @@ name: Build Debian images for PDNS CI on: workflow_dispatch: push: + pull_request: schedule: - cron: '0 23 * * *' @@ -35,6 +36,7 @@ jobs: --build-arg DEBIAN_IMAGE_TAG=${{ matrix.debian-release-name }} - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v2 with: registry: ghcr.io @@ -42,5 +44,6 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push into Github Container Registry + if: ${{ github.event_name != 'pull_request' }} run: | docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }}