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 for TODOs and License headers
2+
3+ on : workflow_call
4+
5+ jobs :
6+ grep_todo_job :
7+ name : Grep TODO and License Headers
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - name : Checkout repository
12+ uses : actions/checkout@v4
13+
14+ - name : Check for TODO statements
15+ run : (find . -iname "*.cs" "*.go" -exec grep -qi "todo" {} \; -print) | tee ./todo_log.txt
16+
17+ - name : Save todo log
18+ if : success()
19+ uses : actions/upload-artifact@v4
20+ with :
21+ name : todologs
22+ path : ./**/todo_log.txt
23+
24+ - name : Check for Apache License headers
25+ run : (find . \( -path "./git*" -o -name "README.md" -o -name "AssemblyInfo.cs" \) -prune -o -type f -iname "*.cs" -iname "*.go"-exec grep -L "Apache License" {} \;) | tee ./license_log.txt
26+
27+ - name : Save license log
28+ if : success()
29+ uses : actions/upload-artifact@v4
30+ with :
31+ name : licenselogs
32+ path : ./**/license_log.txt
33+
34+ - name : Fail if no headers
35+ run : if [ -s "./license_log.txt" ]; then echo "Some files are missing the license header"; exit 1; fi
You can’t perform that action at this time.
0 commit comments