File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Check PR Changes
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+
8+ jobs :
9+ check-assets-updated :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : Get changed files
15+ id : changed
16+ uses : tj-actions/changed-files@v46
17+ with :
18+ files_yaml : |
19+ posts:
20+ - docs/posts/**
21+ assets:
22+ - docs/assets/**
23+ readme:
24+ - README.md
25+
26+ - name : Fail if docs/posts changed but docs/assets or README.md not changed
27+ if : steps.changed.outputs.posts_any_changed == 'true'
28+ run : |
29+ MISSING=()
30+ if [[ "${{ steps.changed.outputs.assets_any_changed }}" != "true" ]]; then
31+ MISSING+=("docs/assets")
32+ fi
33+ if [[ "${{ steps.changed.outputs.readme_any_changed }}" != "true" ]]; then
34+ MISSING+=("README.md")
35+ fi
36+
37+ if [[ ${#MISSING[@]} -gt 0 ]]; then
38+ echo "❌ docs/posts was changed but the following required paths were not updated:"
39+ for m in "${MISSING[@]}"; do
40+ echo " - $m"
41+ done
42+ exit 1
43+ fi
44+
45+ echo "✅ All required files are updated alongside docs/posts."
You can’t perform that action at this time.
0 commit comments