mirror of
https://github.com/saveweb/review-2023.git
synced 2024-09-19 10:15:29 -07:00
Update and rename ban_README_edit to ban_README_edit.yml
This commit is contained in:
parent
1c2dbcccd2
commit
05ce73a484
22
.github/workflows/ban_README_edit
vendored
22
.github/workflows/ban_README_edit
vendored
@ -1,22 +0,0 @@
|
||||
name: Close PR on README.md change
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [edited]
|
||||
|
||||
jobs:
|
||||
close_pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
- name: Check for README.md changes
|
||||
run: |
|
||||
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -q "^README.md$"; then
|
||||
echo "README.md has been modified. Closing the PR."
|
||||
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"state":"closed"}' "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}"
|
||||
else
|
||||
echo "No changes to README.md. Nothing to do."
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
15
.github/workflows/ban_README_edit.yml
vendored
Normal file
15
.github/workflows/ban_README_edit.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
name: Close PR on README changes
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'README.md'
|
||||
|
||||
jobs:
|
||||
close-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close PR if README.md changed
|
||||
uses: peter-evans/close-pull@v3.0.1
|
||||
with:
|
||||
comment: do not edit README.md
|
Loading…
Reference in New Issue
Block a user