From ce469d5fcaa127827c6bbb205b605deb6e7439bf Mon Sep 17 00:00:00 2001 From: Idir Izitounene Date: Wed, 7 Feb 2024 22:20:40 +0100 Subject: [PATCH] Lower github.repository_owner (OKDP -> okdp) --- .../docker-build-test-push-latest.yml | 18 +++++++++++------- .github/workflows/docker-tag-push.yml | 10 +++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-build-test-push-latest.yml b/.github/workflows/docker-build-test-push-latest.yml index 7b58885..59f3436 100644 --- a/.github/workflows/docker-build-test-push-latest.yml +++ b/.github/workflows/docker-build-test-push-latest.yml @@ -57,9 +57,13 @@ jobs: username: ${{ secrets.registry_username }} password: ${{ secrets.registry_token }} + - name: Lower github repository owner + run: echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_ENV + shell: bash + - name: Pull parent image 📥 if: inputs.parent-image != '' - run: docker pull ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.parent-image }} + run: docker pull ${{ inputs.registry }}/$OWNER/${{ inputs.parent-image }} shell: bash - name: Prepare image build (build args) 📦 @@ -70,7 +74,7 @@ jobs: done if [[ "${{ inputs.parent-image }}" ]] then - BUILD_ARGS+="--build-arg BASE_CONTAINER=${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.parent-image }} " + BUILD_ARGS+="--build-arg BASE_CONTAINER=${{ inputs.registry }}/$OWNER/${{ inputs.parent-image }} " fi echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV # The short image name is necessary to run the tests (not pushed, local to jobs only) @@ -86,10 +90,10 @@ jobs: - name: Build image 🛠 run: | #docker buildx build --platform=linux/amd64 --rm --force-rm --tag ... - docker build --rm --force-rm --tag ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }} \ - --tag ${{ inputs.registry }}/${{ github.repository_owner }}/$SHORT_IMAGE_NAME:latest images/$SHORT_IMAGE_NAME/ \ + docker build --rm --force-rm --tag ${{ inputs.registry }}/$OWNER/${{ inputs.image }} \ + --tag ${{ inputs.registry }}/$OWNER/$SHORT_IMAGE_NAME:latest images/$SHORT_IMAGE_NAME/ \ --build-arg REGISTRY=${{ inputs.registry }} \ - --build-arg OWNER=${{ github.repository_owner }} $BUILD_ARGS \ + --build-arg OWNER=$OWNER $BUILD_ARGS \ --label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \ --label "org.opencontainers.image.description=$SHORT_IMAGE_NAME" env: @@ -103,11 +107,11 @@ jobs: # Skip tests when running with ACT if: env.ACT_SKIP_TESTS == '' run: | - python3 -m tests.run_tests --short-image-name $SHORT_IMAGE_NAME --registry ${{ inputs.registry }} --owner ${{ github.repository_owner }} + python3 -m tests.run_tests --short-image-name $SHORT_IMAGE_NAME --registry ${{ inputs.registry }} --owner $OWNER shell: bash - name: Push latest tag image to registry 📤 - run: docker push ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }} + run: docker push ${{ inputs.registry }}/$OWNER/${{ inputs.image }} shell: bash diff --git a/.github/workflows/docker-tag-push.yml b/.github/workflows/docker-tag-push.yml index 50cf897..f7da407 100644 --- a/.github/workflows/docker-tag-push.yml +++ b/.github/workflows/docker-tag-push.yml @@ -47,12 +47,16 @@ jobs: username: ${{ secrets.registry_username }} password: ${{ secrets.registry_token }} + - name: Lower github repository owner + run: echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_ENV + shell: bash + - name: Pull latest tag image 📥 - run: docker pull ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }} + run: docker pull ${{ inputs.registry }}/$OWNER/${{ inputs.image }} shell: bash - name: Apply tags to the loaded image 🏷 - run: python3 -m okdp.extension.tagging.apply_tags --short-image-name ${{ inputs.image }} --registry ${{ inputs.registry }} --owner ${{ github.repository_owner }} + run: python3 -m okdp.extension.tagging.apply_tags --short-image-name ${{ inputs.image }} --registry ${{ inputs.registry }} --owner $OWNER - name: Prepare image push 📦 run: | @@ -61,5 +65,5 @@ jobs: shell: bash - name: Push Images to Registry 📤 - run: docker push --all-tags ${{ inputs.registry }}/${{ github.repository_owner }}/$SHORT_IMAGE_NAME + run: docker push --all-tags ${{ inputs.registry }}/$OWNER/$SHORT_IMAGE_NAME shell: bash