Check if PR is approved #236
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: Check if PR is approved | |
on: | |
pull_request_review: | |
types: [submitted] | |
jobs: | |
merge-branch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 'Prevent merging into development if the PR is not approved' | |
if: github.event.review.state != 'approved' | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('The PR is not approved to be merged into development') | |
- name: 'Is the PR is approved?' | |
if: github.event.review.state == 'approved' | |
run: | | |
mkdir -p ./pr | |
echo ${{ github.event.pull_request.number }} > ./pr/NR | |
- name: 'Store the PR number if approved' | |
if: github.event.review.state == 'approved' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pr | |
path: pr/ |