diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f386d12..29aab53 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -151,6 +151,7 @@ jobs: env: DOCKER_REPO: sippylabs/libg722 BASE_IMAGE: ${{ matrix.base_image }} + DOCKER_RW: ${{ ( github.repository == 'sippy/libg722' && github.event_name != 'pull_request' ) && 'true' || 'false' }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -162,7 +163,7 @@ jobs: platforms: arm64,arm,riscv64,mips64le,ppc64le,s390x - name: Log in to Docker Hub - if: github.event_name != 'pull_request' && github.repository == 'sippy/libg722' + if: ${{ env.DOCKER_RW }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} @@ -206,6 +207,6 @@ jobs: platforms: ${{ env.PLATFORMS }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - push: ${{ github.repository == 'sippy/libg722' && 'true' || 'false' }} + push: ${{ env.DOCKER_RW }} cache-from: ${{ env.CACHE_SPEC }} cache-to: ${{ env.CACHE_SPEC }},mode=max