Auto merge main branch on update for branches with auto-merge enabled #306
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.
Adds auto-updating of PR branches with the content of the base branch, if the PR branch is marked for auto-merge in Github.
I have examined the Typescript code in https://github.com/tibdex/auto-update/blob/main/src/index.ts for security but have not examined the Javascript that it compiles into, and I have also examined the Github Action that they use to release new Github Actions versions. This PR specifically locks the branch to tag v2.1.2 rather than v2; the underlying release process reassigns the vX and vX.Y tag on minor and patch releases, and this hopefully minimizes (although does not eliminate) the possibility of malicious code being introduce into the action.
Note that we have set up the action to only trigger on pushes to
main
branch; if a PR has a base branch that is notmain
, the action is not triggered automatically. However, the next time main is pushed to, it will run on all branches, including branches where main is not the target.In the case of merge conflicts, the action will add a comment to the PR and not merge, which should hopefully notify the PR author to take action.
This is intended to be a replacement for the use of CZI's auto-merge bot; the combination of this Github Action and Github auto-merge should fully replace the need for the bot.