Automerge PR #9
Workflow file for this run
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 PR | |
on: | |
pull_request_review: | |
types: [submitted] | |
jobs: | |
automerge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install gh | |
run: | | |
npm install -g gh | |
- name: Get approval status | |
id: get_approval_status | |
run: | | |
echo "::set-output name=approval_status::${{ github.context.payload.pull_request.review.state }}" | |
- name: Merge PR | |
if: ${{ steps.get_approval_status.outputs.approval_status == 'APPROVED' }} | |
run: gh pr merge --all | |
- name: Add labels | |
if: ${{ steps.get_approval_status.outputs.approval_status == 'APPROVED' }} | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.issues.addLabels({ | |
issue_number: github.context.payload.pull_request.number, | |
labels: ['merged', 'approved'] | |
}) |