Skip to content

Commit 85ad51d

Browse files
committed
improve todo checker
1 parent d047177 commit 85ad51d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/check-upstream-todos.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ jobs:
4242
URLS=$(echo "$TODOS" | grep -oE "https://github\.com/[^/]+/[^/]+/(pull|issues)/[0-9]+" | sort -u)
4343
4444
FAILED=false
45+
FAILED_LOCATIONS=""
4546
4647
for URL in $URLS; do
4748
echo "Checking: $URL"
4849
50+
# Find all locations where this URL appears
51+
LOCATIONS=$(echo "$TODOS" | grep -F "$URL" || true)
52+
4953
# Extract owner, repo, type (pull or issues), and number from URL
5054
if [[ $URL =~ https://github\.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+) ]]; then
5155
OWNER="${BASH_REMATCH[1]}"
@@ -62,7 +66,12 @@ jobs:
6266
6367
if [ "$STATE" == "closed" ] && [ "$MERGED" == "true" ]; then
6468
echo " ❌ FAIL: PR #$NUMBER is MERGED! Remove TODO and workaround."
69+
echo " Locations:"
70+
while IFS= read -r line; do
71+
echo " $line"
72+
done <<< "$LOCATIONS"
6573
FAILED=true
74+
FAILED_LOCATIONS="$FAILED_LOCATIONS$LOCATIONS"$'\n'
6675
elif [ "$STATE" == "closed" ] && [ "$MERGED" == "false" ]; then
6776
echo " ⚠️ PR #$NUMBER is closed but not merged."
6877
elif [ "$STATE" == "open" ]; then
@@ -77,7 +86,12 @@ jobs:
7786
7887
if [ "$STATE" == "closed" ]; then
7988
echo " ❌ FAIL: Issue #$NUMBER is CLOSED! Remove TODO and workaround."
89+
echo " Locations:"
90+
while IFS= read -r line; do
91+
echo " $line"
92+
done <<< "$LOCATIONS"
8093
FAILED=true
94+
FAILED_LOCATIONS="$FAILED_LOCATIONS$LOCATIONS"$'\n'
8195
elif [ "$STATE" == "open" ]; then
8296
echo " ✅ Issue #$NUMBER is still open."
8397
else
@@ -93,6 +107,9 @@ jobs:
93107
if [ "$FAILED" == "true" ]; then
94108
echo "❌ One or more upstream issues/PRs have been resolved!"
95109
echo "Please review and remove the corresponding TODO comments and workarounds."
110+
echo ""
111+
echo "Summary of resolved TODOs:"
112+
echo "$FAILED_LOCATIONS"
96113
exit 1
97114
else
98115
echo "✅ All upstream issues/PRs are still unresolved."

0 commit comments

Comments
 (0)