Skip to content

Commit

Permalink
fix TODO check
Browse files Browse the repository at this point in the history
  • Loading branch information
CritasWang committed Dec 13, 2024
1 parent 73c1e32 commit e2075ec
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/todos-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ jobs:
# Fetch the target branch
git fetch origin $GITHUB_BASE_REF
# Check if there is a common ancestor
if git merge-base --is-ancestor origin/$GITHUB_BASE_REF HEAD; then
# Get the diff of the changes
DIFF=$(git diff origin/$GITHUB_BASE_REF...HEAD)
else
# If no common ancestor, compare with the initial commit
DIFF=$(git diff $(git hash-object -t tree /dev/null) HEAD)
fi
git switch -c check_branch
# Get the diff of the changes
DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch)
# Check the diff for TODOs
if echo "$DIFF" | grep -Eq '^\+.*(TODO|FIXME)'; then
Expand Down

0 comments on commit e2075ec

Please sign in to comment.