File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 44 pull_request :
55 branches :
66 - master
7+ - ' dev/*'
78 - ' rel/*'
89 - " rc/*"
910 - ' force_ci/**'
@@ -29,13 +30,19 @@ jobs:
2930 git switch -c check_branch
3031
3132 # Get the diff of the changes
32- DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch)
33+ echo Get the diff of the changes
34+ DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch -- . ':(exclude).github/workflows/todos-check.yml')
3335
34-
36+ if [ -z "$DIFF" ]; then
37+ echo "No changes detected."
38+ exit 0
39+ fi
3540 # Check the diff for TODOs
36- if echo "$DIFF" | grep -Eq '^\+.*(TODO|FIXME)'; then
37- echo "TODO or FIXME found in the changes. Please resolve it before merging."
38- # exit 1
41+ echo "$DIFF" | grep -E '^\+.*(TODO|FIXME)' > check.log
42+ if [ $(wc -l < check.log> -eq 0)]; then
43+ echo "No TODOs or FIXMEs found in changed content."
3944 else
40- echo "No TODOs found in changed content."
45+ echo "TODO or FIXME found in the changes. Please resolve it before merging."
46+ cat check.log
47+ exit 1
4148 fi
You can’t perform that action at this time.
0 commit comments