diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..4b56cea469 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1 @@ + diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000000..3cd5079778 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,22 @@ +name: Auto Merge Bot + +on: + # GitHub considers PRs as issues + issue_comment: + types: [created] + +jobs: + set-auto-merge: + runs-on: ubuntu-latest + # Important! This forces the job to run only on comments on Pull Requests that starts with '/merge' + if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }} + steps: + - name: Get the GitHub handle of the fellows + uses: paritytech/get-fellows-action@v1.0.0 + id: fellows + - name: Set auto merge + uses: paritytech/auto-merge-bot@v1.0.0 + with: + GITHUB_TOKEN: '${{ github.token }}' + MERGE_METHOD: "SQUASH" + ALLOWLIST: ${{ steps.fellows.outputs.github-handles }} diff --git a/README.md b/README.md index bf033bfbeb..874f47819e 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,15 @@ Each leaf folder contains one runtime crate: └── gluttons └── glutton-kusama ``` + +# Working on Pull Requests + +To merge a pull request, we use [Auto Merge Bot](https://github.com/paritytech/auto-merge-bot). + +To use it, write a comment in a PR that says: + +> `/merge` + +This will enable [`auto-merge`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) in the Pull Request (or merge it if it is ready to merge). + +The automation can be triggered by the author of the PR or any fellow whose GitHub handle is part of their identity.