Преглед изворни кода

fix: dependabot no need push image (#39)

zijiren пре 9 месеци
родитељ
комит
0f677dfb7e
1 измењених фајлова са 7 додато и 7 уклоњено
  1. 7 7
      .github/workflows/release.yml

+ 7 - 7
.github/workflows/release.yml

@@ -109,7 +109,7 @@ jobs:
     runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }}
     steps:
       - name: Login to GitHub Container Registry
-        if: ${{ github.event_name != 'pull_request' }}
+        if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
         uses: docker/login-action@v3
         with:
           registry: ghcr.io
@@ -118,14 +118,14 @@ jobs:
 
       - name: Login to DockerHub
         uses: docker/login-action@v3
-        if: ${{ github.event_name != 'pull_request' && env.DOCKERHUB_REPO }}
+        if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' && env.DOCKERHUB_REPO }}
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
       - name: Login to Aliyun Registry
         uses: docker/login-action@v3
-        if: ${{ github.event_name != 'pull_request' && env.ALIYUN_REGISTRY }}
+        if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' && env.ALIYUN_REGISTRY }}
         with:
           registry: ${{ env.ALIYUN_REGISTRY }}
           username: ${{ secrets.ALIYUN_USERNAME }}
@@ -153,7 +153,7 @@ jobs:
           context: .
           labels: ${{ steps.meta.outputs.labels }}
           platforms: linux/${{ matrix.arch }}
-          outputs: type=image,"name=${{ env.GHCR_REPO }}${{ env.DOCKERHUB_REPO && format(',{0}', env.DOCKERHUB_REPO) }}${{ env.ALIYUN_REPO && format(',{0}', env.ALIYUN_REPO) }}",name-canonical=true,push-by-digest=${{ github.event_name != 'pull_request' }},push=${{ github.event_name != 'pull_request' }}
+          outputs: type=image,"name=${{ env.GHCR_REPO }}${{ env.DOCKERHUB_REPO && format(',{0}', env.DOCKERHUB_REPO) }}${{ env.ALIYUN_REPO && format(',{0}', env.ALIYUN_REPO) }}",name-canonical=true,push-by-digest=${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }},push=${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
 
       - name: Export digest
         run: |
@@ -173,7 +173,7 @@ jobs:
     name: Push Docker Images
     needs: build-docker-images
     runs-on: ubuntu-24.04
-    if: ${{ github.event_name != 'pull_request' }}
+    if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
     steps:
       - name: Login to GitHub Container Registry
         uses: docker/login-action@v3
@@ -184,14 +184,14 @@ jobs:
 
       - name: Login to DockerHub
         uses: docker/login-action@v3
-        if: ${{ github.event_name != 'pull_request' && env.DOCKERHUB_REPO }}
+        if: ${{ env.DOCKERHUB_REPO }}
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
       - name: Login to Aliyun Registry
         uses: docker/login-action@v3
-        if: ${{ github.event_name != 'pull_request' && env.ALIYUN_REGISTRY }}
+        if: ${{ env.ALIYUN_REGISTRY }}
         with:
           registry: ${{ env.ALIYUN_REGISTRY }}
           username: ${{ secrets.ALIYUN_USERNAME }}