From d620eb429278d272741da8a746664fb2d50f8fdc Mon Sep 17 00:00:00 2001 From: Jeroen Op 't Eynde Date: Thu, 10 Jun 2021 23:09:29 +0200 Subject: [PATCH] fix(actions): don't login/push on forks (#22) --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2f2e6c3..d238b66 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -37,6 +37,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - + if: github.event.pull_request.head.repo.full_name == github.repository name: Login to DockerHub uses: docker/login-action@v1 with: @@ -48,7 +49,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name != 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} -