Skip to content

Commit 40f666e

Browse files
committed
modified: .github/workflows/00_vetting.yml
1 parent 2d8c3c2 commit 40f666e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/00_vetting.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
name: Check Unvetted Modules
1+
name: Vetted PR Check
22

33
on:
44
pull_request:
55
types: [opened, reopened, edited, synchronize, review_requested]
66

77
jobs:
8-
validate_unvetted:
8+
check-staging-only:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout code
11+
- name: Checkout PR
1212
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0 # Needed to compare full history
1315

14-
- name: Check for unvetted files outside staging
16+
- name: Ensure only staging files changed
1517
run: |
16-
unvetted=$(git diff --name-only origin/main HEAD | grep -E '^(src/.*\.(sh|conf|png|jpg|jpeg|gif|svg))$' || true)
18+
# Get the list of files changed in the PR
19+
unvetted=$(git diff --name-only origin/main HEAD \
20+
| grep -E '^(src/.*|docs/.*|lib/.*|other_generated/.*)' || true)
21+
22+
# Remove any changes under staging
23+
unvetted=$(echo "$unvetted" | grep -v '^staging/')
24+
1725
if [[ -n "$unvetted" ]]; then
18-
echo "ERROR: Found unvetted files outside ./staging:"
26+
echo "ERROR: PR contains changes outside ./staging:"
1927
echo "$unvetted"
2028
exit 1
29+
else
30+
echo "✅ Only ./staging files modified. PR passes vetted check."
2131
fi

0 commit comments

Comments
 (0)