Explorar o código

Use "github.event.repository.default_branch" variable (#10)

Mohammad Abdolirad %!s(int64=2) %!d(string=hai) anos
pai
achega
583be10cc2
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      .github/workflows/ci.yml

+ 2 - 2
.github/workflows/ci.yml

@@ -57,7 +57,7 @@ jobs:
       - name: Build images
         uses: docker/bake-action@v2
         with:
-          push: ${{ github.ref == 'refs/heads/master' }}
+          push: ${{ github.ref_name == github.event.repository.default_branch }}
           targets: ${{ matrix.variant }}
           files: |
             ./docker-bake.hcl
@@ -67,7 +67,7 @@ jobs:
 
       - name: Docker Hub Description
         uses: peter-evans/dockerhub-description@v3
-        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+        if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}