Skip to content

Commit 0128504

Browse files
amide-initclaude
andcommitted
Add workflow to enforce empty data files on main branch
Fails if any data/*.json contains non-empty content on main, preventing personal data from accidentally landing on the template branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d5fff0c commit 0128504

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate main branch stays clean
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- 'data/**'
7+
- 'gitforge.config.json'
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- 'data/**'
12+
- 'gitforge.config.json'
13+
14+
jobs:
15+
validate:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Ensure data files are empty templates
21+
run: |
22+
fail=0
23+
for file in data/blogs.json data/posts.json data/projects.json data/videos.json; do
24+
content=$(cat "$file" | tr -d '[:space:]')
25+
if [ "$content" != "[]" ]; then
26+
echo "❌ $file must be [] on main (personal data belongs on the web branch)"
27+
fail=1
28+
else
29+
echo "✅ $file is clean"
30+
fi
31+
done
32+
exit $fail

0 commit comments

Comments
 (0)