Server dummy patch 2 #1
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: PR Review | |
on: | |
pull_request: | |
branches: [master] | |
jobs: | |
review: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check for template | |
run: | | |
# Replace "## Pull Request Template" with the actual template string | |
if echo "${{ github.event.pull_request.body }}" | grep "## Pull Request Template" > /dev/null; then | |
echo "Template found!" | |
else | |
echo "Error: PR template is missing!" | |
exit 1 | |
fi | |
- name: Set draft status | |
if: always() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
state: 'draft' | |
}) | |
- name: Add bot-review label | |
if: always() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
labels: ['bot-review'] | |
}) | |
- name: Remove bot-review label | |
if: always() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.removeLabel({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
name: 'bot-review' | |
}) |