-
Notifications
You must be signed in to change notification settings - Fork 37
61 lines (55 loc) · 1.64 KB
/
pull_request_code_warning.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "[PR] Code Warning"
on:
pull_request:
types: [opened, synchronize, reopened]
path-ignores:
- '.github/**'
- '**/deploy/**'
- '**/Dockerfile'
- '**/*.dockerfile'
- '**/*.dockerignore'
- '**/LICENSE'
- '**/AUTHORS'
- '**/.husky/**'
- '**/commitlint.config.js'
- '**/.lintstagedrc.js'
- '**/*.md'
- '**/*.env'
branches:
- master
- feature-*
workflow_dispatch:
jobs:
review:
runs-on: ubuntu-latest
env:
NODE_ENV: 'development'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check for TODOs
run: |
echo "Checking for TODOs..."
grep -rl "TODO" . --exclude-dir={node_modules,.git} > todo_files.txt || true
if [ -s todo_files.txt ]; then
echo "The following files contain TODOs:"
cat todo_files.txt
while IFS= read -r file; do
echo "::warning file=$file::File contains TODO"
done < todo_files.txt
else
echo "No TODOs found."
fi
- name: Check for console.log
run: |
echo "Checking for console.log..."
grep -rl "console.log" . --exclude-dir={node_modules,.git} > console_log_files.txt || true
if [ -s console_log_files.txt ]; then
echo "The following files contain console.log:"
cat console_log_files.txt
while IFS= read -r file; do
echo "::warning file=$file::File contains console.log"
done < console_log_files.txt
else
echo "No console.log found."
fi