From b950807fd2eec410062abd91c820cdfdb7fac353 Mon Sep 17 00:00:00 2001
From: Yamagishi Kazutoshi <ykzts@desire.sh>
Date: Thu, 24 Feb 2022 00:44:16 +0900
Subject: [PATCH] Skip Docker Hub login for pull requests (#17625)

* Skip Docker Hub login for pull requests

* Add support pr tag
---
 .github/workflows/build-image.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml
index 92a164c40e..f8b4a751dc 100644
--- a/.github/workflows/build-image.yml
+++ b/.github/workflows/build-image.yml
@@ -21,6 +21,7 @@ jobs:
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
+        if: github.event_name != 'pull_request'
       - uses: docker/metadata-action@v3
         id: meta
         with:
@@ -30,6 +31,7 @@ jobs:
           tags: |
             type=edge,branch=main
             type=semver,pattern={{ raw }}
+            type=ref,event=pr
       - uses: docker/build-push-action@v2
         with:
           context: .
-- 
GitLab