Use the more idiomatic property that signals a fork

Pulled from https://til.cazzulino.com/devops-ci-cd/how-to-skip-steps-or-jobs-in-github-actions-for-prs-from-forks
This commit is contained in:
Daniel Cazzulino 2022-08-11 12:28:48 -03:00 committed by GitHub
parent 10db75894f
commit 77e7ec720f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,7 +127,7 @@ jobs:
example:
runs-on: ubuntu-latest
# Check if the event is not triggered by a fork
if: github.event.pull_request.head.repo.full_name == github.repository
if: ${{ !github.event.pull_request.head.repo.fork }}
```
For further reading regarding the security of pull requests, see this GitHub blog post titled [Keeping your GitHub Actions and workflows secure: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)