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.
This commit is contained in:
Thomas Eizinger 2023-09-14 09:46:08 +10:00 committed by GitHub
parent 1fff308d19
commit def4ac48ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }}