feat: check TODO in review action #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |