Skip to content

Commit 9ad2bc1

Browse files
committed
chore(consolidation): copy action from repo cpr-release-checks
1 parent 93f4377 commit 9ad2bc1

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)