(maint) - Update checkout ref on mend pr trigger #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
We need a way to run mend scanning on PRs to our repos, but due to security you cannot access the necessary secrets on
pull_request
. Now, we will trigger our mend scans onpull_request_target
which will have access to the necessary secrets, but by default this runs in the context of the base branch.Now we will use the workflow from main, but the code from the pr, to enable us to run mend scanning safely on all submitted prs.
Inspired by https://dev.to/suzukishunsuke/secure-github-actions-by-pullrequesttarget-641#:~:text=To%20checkout%20the%20merged%20commit,to%20actions%2Fcheckout%20input%20ref%20.
Additional Context
Add any additional context about the problem here.
Related Issues (if any)
Mention any related issues or pull requests.
Checklist