'How can I make GitHub Actions work with PRs made by external contributors?

My GitHub actions depend on some GitHub secrets that I set in my repo:

GitHub secrets

CI works when I push a commit:

https://github.com/paulrberg/prb-proxy/actions/runs/1958606928

But it fails when an external contributor makes a PR from their forked version of the repo:

https://github.com/paulrberg/prb-proxy/runs/4581619160

The execution fails because of this error:

Error: Please set MNEMONIC as an env variable

But the MNEOMNIC secret is there. Why doesn't it work when the GitHub Action is triggered by a PR made by an external contributor?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source