Skip to content

Commit

Permalink
fix(ci): only push docker image if we have the necessary permissions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thomaseizinger authored Sep 13, 2023
1 parent 1fff308 commit def4ac4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit def4ac4

Please sign in to comment.