GitHub Actions has introduced a new event type: pull_request_target
https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#pull_request_target
This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.
In order to solve this [security issues with pull_request], we’ve added a new pull_request_target event, which behaves in an almost identical way to the pull_request event with the same set of filters and payload. However, instead of running against the workflow and code from the merge commit, the event runs against the workflow and code from the base of the pull request. This means the workflow is running from a trusted source and is given access to a read/write token as well as secrets enabling the maintainer to safely comment on or label a pull request.
Switching this in to the .github/workflows/branch.yml workflow should mean that we can have automated comments for PRs coming from forks, rather than just branches 🎉
I would like to also use it in linting.yml, which would that we could have the nice automated comment with the nf-core lint results from fork PRs. However, I think that we want lint tests to run on the merge commit code, so we probably shouldn't switch this one 😞
GitHub Actions has introduced a new event type:
pull_request_targetSwitching this in to the
.github/workflows/branch.ymlworkflow should mean that we can have automated comments for PRs coming from forks, rather than just branches 🎉I would like to also use it in
linting.yml, which would that we could have the nice automated comment with thenf-core lintresults from fork PRs. However, I think that we want lint tests to run on the merge commit code, so we probably shouldn't switch this one 😞