From def4ac48ed37ddb14dbc9e900d3ad1e7fe50fc1f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 14 Sep 2023 09:46:08 +1000 Subject: [PATCH] fix(ci): only push docker image if we have the necessary permissions We run this workflow in several contexts: `pull_request`, `tags` and `push`. For the events that are not `pull_request`, this property won't be defined, i.e. be `undefined`. Negating that should yield `true` which is what we want: push the image for the `master` branch and on new tags that start with `libp2p-server-*`. Pull-Request: #4502. --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index cd9a3fc7..2378e8ff 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -34,6 +34,6 @@ jobs: with: context: . file: ./misc/server/Dockerfile - push: true + push: ${{ ! github.event.pull_request.head.repo.fork }} # Only push image if we have the required permissions, i.e. not running from a fork tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}