From 43fb542fc16d1c9c4baa74227c7980810c334ef7 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Fri, 16 Dec 2022 08:12:57 +0100 Subject: [PATCH] build workflow fix (don't run docker login in PR's) --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbe26c6..181b749 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,12 +42,15 @@ jobs: run: | go test ./... + # only on tags or the master branch - name: Docker Login + if: success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + # only on tags - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 if: success() && startsWith(github.ref, 'refs/tags/') @@ -57,6 +60,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # only on the master branch - name: Build and push latest docker image if: success() && github.ref == 'refs/heads/master' run: |