Skip to content

Commit b1e07c7

Browse files
authored
fix todos-check (#14851)
1 parent 6233e53 commit b1e07c7

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/todos-check.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
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

0 commit comments

Comments
 (0)