-
Notifications
You must be signed in to change notification settings - Fork 1
29 lines (24 loc) · 860 Bytes
/
Copy pathpr-checker.yml
File metadata and controls
29 lines (24 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: PR Checker
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get list of changed files
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.sha }})
echo "Changed files: $CHANGED_FILES"
echo "Base commit: ${{ github.event.pull_request.base.sha }}"
echo "Current commit: ${{ github.sha }}"
if [[ "$CHANGED_FILES" == "README.md" ]]; then
echo ":white_check_mark: README.md file is allowed to change."
else
echo ":x: Only README.md is allowed to change. Found changes or restricted files: $CHANGED_FILES"
exit 1
fi