-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.05 KB
/
GUARDIAN.yml
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
30
31
32
33
34
35
36
name: 커밋 검증
on:
pull_request:
branches:
- 'develop/**'
jobs:
guard-modifications:
name: 위험한 수정이 있는지 확인
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 커밋 체크
run: |
TARGET_FILES=("KuringPackage/Sources/Networks/Resources/KuringLink-info.plist")
CHANGED_FILES=$(git diff --name-only HEAD^)
echo "$CHANGED_FILES"
MODIFIED_TARGET_FILES=()
for TARGET_FILE in "${TARGET_FILES[@]}"; do
if [[ $CHANGED_FILES == *"$TARGET_FILE"* ]]; then
MODIFIED_TARGET_FILES+=("$TARGET_FILE")
fi
done
if [ ${#MODIFIED_TARGET_FILES[@]} -gt 0 ]; then
for MODIFIED_FILE in "${MODIFIED_TARGET_FILES[@]}"; do
echo "::error:: $MODIFIED_FILE 에서 올바르지 않은 수정이 발견되었습니다."
done
exit 1
fi