It recently occurred to me that the on pull_request event for GitHub actions can be triggered by absolutely anyone if you have a public repository.
i.e.:
- Someone clones my repository
- They add a
something.ymlfile to.github/workflowsthat runs on thepull_requestevent - They create a pull request
The action that they specify in a pull request is then run. If you have a self-hosted runner then literally any person on the planet can run shell commands on your server in the context of the self-hosted runner's user.
If this works as I think it does, any human on the planet can run arbitrary code on your server simply with a pull request. I tried this and it seems to be the case.
How can I whitelist hooks that actions can be triggered by on a repository? Or otherwise, how can I safely use Github Actions with a public repository and a self-hosted runner. I have seen the warning... I just assumed that I had to be careful not to accept pull requests from unknown provenance.
