automerge #13974
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
--- | |
name: automerge | |
on: | |
workflow_run: | |
types: | |
- completed | |
workflows: | |
- "ci" | |
jobs: | |
print-debug-info: | |
name: Print debug info | |
runs-on: ubuntu-latest | |
steps: | |
- uses: hmarr/debug-action@v2 | |
automerge: | |
name: Automerge | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' }} | |
outputs: | |
pr-number: ${{ steps.find-pull-request.outputs.number }} | |
steps: | |
- name: Find Pull Request | |
uses: juliangruber/[email protected] | |
id: find-pull-request | |
with: | |
branch: ${{ github.event.workflow_run.head_branch }} | |
- name: Merge PR | |
uses: ridedott/merge-me-action@master | |
if: steps.find-pull-request.outputs.number | |
with: | |
GITHUB_LOGIN: nsmbot | |
ENABLED_FOR_MANUAL_CHANGES: true | |
GITHUB_TOKEN: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} | |
MAXIMUM_RETRIES: 25 | |
delete-release-branch: | |
name: Delete Release Branch | |
runs-on: ubuntu-latest | |
needs: automerge | |
if: ${{ needs.automerge.outputs.pr-number && contains(github.event.workflow_run.head_branch, 'release/') }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} | |
- name: Delete release branch | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "NSMBot" | |
git push origin --delete ${{ github.event.workflow_run.head_branch }} |