File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333
3434 for f in "${CHANGED[@]}"; do
3535 [ -f "$f" ] || continue
36+ # Don't scan CI/workflow files
37+ [[ "$f" == .github/* ]] && continue
3638 case "$f" in
3739 *.md|*.txt|*.yml|*.yaml|*.json|*.toml|*.ts|*.tsx|*.js|*.jsx|*.sh|*.py|*.rb|*.tf|*.hcl)
3840 if grep -Einq "$FORBIDDEN" "$f"; then
Original file line number Diff line number Diff line change 2020 - uses : dorny/paths-filter@v3
2121 id : filter
2222 with :
23+ list-files : shell
2324 filters : |
2425 source:
2526 - '**/*.ts'
3334 - '**/*.sh'
3435 - '!**/*.test.*'
3536 - '!**/*.spec.*'
37+ - '!.github/**'
38+ - '!**/*.md'
3639 tests:
3740 - '**/*.test.*'
3841 - '**/*.spec.*'
4447 if : needs.changed-files.outputs.source_changed == 'true'
4548 runs-on : ubuntu-latest
4649 steps :
50+ - name : Report changed files
51+ run : |
52+ echo "Source files changed: ${{ needs.changed-files.outputs.source_changed }}"
53+ echo "Test files changed: ${{ needs.changed-files.outputs.tests_changed }}"
54+
4755 - name : Require test updates when source changes
4856 run : |
4957 if [ "${{ needs.changed-files.outputs.tests_changed }}" != "true" ]; then
50- echo "Source files changed without accompanying test changes."
58+ echo "::error::Source files changed without accompanying test changes."
59+ echo "Note: .md, .github/*, and test files are excluded from source filter."
5160 exit 1
5261 fi
You can’t perform that action at this time.
0 commit comments