Skip to content

Conversation

@arcanis
Copy link
Member

@arcanis arcanis commented Mar 3, 2022

What's the problem this PR addresses?

Smart merge currently requires to go into the Actions tab and pick the right action with the right parameters. Additionally it's not great in terms of security since the running code has access to the yarnbot token. Even with manual trigger, there's a decent chance someone could social-engineer us into running it on a malicious PR.

How did you fix it?

  • The action is now triggered by adding the infra: pending update label to a PR
  • Immediately, a privileged pull_request_target action will trigger and remove the label
  • In parallel, an unprivileged pull_request trigger will generate a patchfile and store it as an artifact
  • Once finished, a privileged workflow_run workflow will retrieve the patchfile and create the commit

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit 920ef4f into master Mar 3, 2022
@arcanis arcanis deleted the mael/smart-merge-v2 branch March 3, 2022 12:39
arcanis added a commit that referenced this pull request Mar 7, 2022
arcanis added a commit that referenced this pull request Mar 7, 2022
trivikr pushed a commit to trivikr/berry that referenced this pull request Mar 9, 2022
trivikr pushed a commit to trivikr/berry that referenced this pull request Mar 9, 2022
merceyz pushed a commit that referenced this pull request Oct 22, 2023
(cherry picked from commit c225c1f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants