Skip to content

Commit 77f350e

Browse files
authored
fix TODO check
1 parent 8b220c9 commit 77f350e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

.github/workflows/todos-check.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ jobs:
2525
# Fetch the target branch
2626
git fetch origin $GITHUB_BASE_REF
2727
28-
# Check if there is a common ancestor
29-
if git merge-base --is-ancestor origin/$GITHUB_BASE_REF HEAD; then
30-
# Get the diff of the changes
31-
DIFF=$(git diff origin/$GITHUB_BASE_REF...HEAD)
32-
else
33-
# If no common ancestor, compare with the initial commit
34-
DIFF=$(git diff $(git hash-object -t tree /dev/null) HEAD)
35-
fi
28+
git switch -c check_branch
29+
30+
# Get the diff of the changes
31+
DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch)
32+
3633
3734
# Check the diff for TODOs
3835
if echo "$DIFF" | grep -Eq '^\+.*(TODO|FIXME)'; then

0 commit comments

Comments
 (0)