Auto Squash #5905
This file contains 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
# auto merge any pr that | |
# 1. has ` [bot]` at the end of the pr title | |
# 2. has `automerge` and `automerge-squash` label | |
# note the first character in ` [bot]` is a thin space https://www.wikiwand.com/en/Thin_space | |
name: Auto Squash | |
on: | |
pull_request: | |
branches: | |
- mainnet | |
- sepolia | |
types: | |
- labeled | |
- synchronize | |
- opened | |
- edited | |
- ready_for_review | |
- reopened | |
- unlocked | |
pull_request_review: | |
types: | |
- submitted | |
status: {} | |
jobs: | |
# merge with WRITE_TOKEN so that subsequent actions can be triggered | |
# merge with squash | |
automerge-squash: | |
if: | | |
endsWith(github.event.pull_request.title, ' [bot]') && | |
!( | |
github.head_ref == 'mainnet' && | |
github.base_ref == 'sepolia' | |
) | |
runs-on: ubuntu-latest | |
steps: | |
- id: automerge-squash | |
name: automerge-squash | |
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: "${{ secrets.WRITE_TOKEN }}" | |
MERGE_METHOD: "squash" | |
MERGE_LABELS: "automerge, automerge-squash" | |
MERGE_REMOVE_LABELS: "automerge, automerge-squash" | |
MERGE_COMMIT_MESSAGE: "Auto squash #{pullRequest.number} [bot]" |