Auto merge bot #107
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto merge bot | |
| on: | |
| pull_request_target: | |
| types: | |
| - labeled | |
| - unlabeled | |
| check_suite: | |
| types: | |
| - success | |
| status: {} | |
| jobs: | |
| automerge: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Labels status comment | |
| if: github.event_name == 'pull_request_target' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| GITHUB_TOKEN: '${{ secrets.BOT_PAT }}' | |
| header: 'status' | |
| recreate: true | |
| message: | | |
| ✨PR Status ✨ | |
| | Condition | | | |
| | ------------- | ------------- | | |
| | Has Required Labels `approved, lgtm` | ${{ contains( github.event.pull_request.labels.*.name, 'approved') && | |
| contains( github.event.pull_request.labels.*.name, 'lgtm') && '✅' || '❌' }} | | |
| | No Blocking Labels `wip, hold` | ${{ (contains( github.event.pull_request.labels.*.name, 'wip') || | |
| contains( github.event.pull_request.labels.*.name, 'hold')) && '❌' || '✅' }} | | |
| _This Pull Request will not merge until all required tests have passed_ | |
| - name: Auto merge if labels ok # And required cheacks pass, enforced by user credentials | |
| id: automerge | |
| uses: 'pascalgn/[email protected]' | |
| env: | |
| GITHUB_TOKEN: '${{ secrets.BOT_PAT }}' # User must not have admin credentials | |
| MERGE_LABELS: 'approved,lgtm,!WIP,!hold' | |
| MERGE_METHOD: squash |