Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) - Update checkout ref on mend pr trigger #75

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

jordanbreen28
Copy link
Contributor

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 on pull_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.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@jordanbreen28 jordanbreen28 marked this pull request as ready for review February 1, 2024 09:20
@jordanbreen28 jordanbreen28 requested a review from a team as a code owner February 1, 2024 09:20
Copy link
Contributor

@LukasAud LukasAud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LukasAud LukasAud merged commit bc2b3bd into main Feb 1, 2024
3 of 4 checks passed
@LukasAud LukasAud deleted the maint-update_checkout_ref_mend branch February 1, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants