From 11cd4817b4133374b2f43e83203f12eaee69b34e Mon Sep 17 00:00:00 2001 From: fuma419 Date: Mon, 22 Apr 2024 20:04:16 +0000 Subject: [PATCH] docker push should not try to target the fork account only during a merge --- .github/workflows/premerge.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yml b/.github/workflows/premerge.yml index 287749711..0c8daf8ce 100644 --- a/.github/workflows/premerge.yml +++ b/.github/workflows/premerge.yml @@ -78,7 +78,11 @@ jobs: echo "PREMERGE_IMAGE_ID1=${PREMERGE_IMAGE_ID1}" >> $GITHUB_ENV - name: Push pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} run: | - docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} + if [ "$IS_FORK" = "true" ]; then + docker push ${{ env.REGISTRY }}/${{ REPO_OWNER }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} + else + docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} + fi - name: Testing cabal-build-all.sh (IO fork of libsodium) run: | echo "Working from PR Branch ${{ env.G_ACCOUNT }}/guild-operators/${{ env.BRANCH }} on COMMIT_SHA ${{ env.COMMIT_SHA }}" @@ -98,7 +102,11 @@ jobs: echo "PREMERGE_IMAGE_ID2=${PREMERGE_IMAGE_ID2}" >> $GITHUB_ENV - name: Push pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} run: | - docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} + if [ "$IS_FORK" = "true" ]; then + docker push ${{ env.REGISTRY }}/${{ REPO_OWNER }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} + else + docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} + fi - name: Add summary details if: always() run: |