Skip to content

Commit

Permalink
Add workflow to auto merge PRs (#2485)
Browse files Browse the repository at this point in the history
* Add workflow to auto merge PRs

* Remove the pull_request_review trigger

It will always fail for forks and it's unlikely that a PR review
will be the step before an automerge (usually the label comes after
an approval OR a check completes).
In cases where it would have triggered the workflow and a merge,
the user can always manually merge after their approval anyway.
  • Loading branch information
michaelbeaumont authored Aug 21, 2020
1 parent 0dd76e7 commit 1cc9746
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: automerge
on:
pull_request_target:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "JakeChampion/automerge-action@e2f6d39bda"
env:
MERGE_LABELS: ""
MERGE_METHOD: "merge"
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash"
MERGE_METHOD_LABEL_REQUIRED: "true"
# Will automatically update the head branch with
# base branch changes
# At the moment, it needs to be a separate label
UPDATE_LABELS: "autoupdate"
# This is OK because weaveworksbot only has write permissions
# if it were an admin, it might override the checks/reviews
# see pascalgn/automerge-action#65
GITHUB_TOKEN: "${{ secrets.WEAVEWORKSBOT_TOKEN }}"

0 comments on commit 1cc9746

Please sign in to comment.