Skip to content

Commit f59278c

Browse files
sylvansysclaude
andcommitted
debug: Add logging to issue detection
Add debug output to understand why issue extraction is failing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 561f561 commit f59278c

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/actions/requirements-reviewer/action.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,16 @@ runs:
5252
5353
BRANCH="${{ inputs.branch }}"
5454
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
55+
echo "DEBUG: Branch name is '$BRANCH'"
5556
5657
# Extract issue number from branch name (e.g., "123-feature-name")
5758
ISSUE=""
58-
[[ $BRANCH =~ ^([0-9]+)- ]] && ISSUE="${BASH_REMATCH[1]}"
59+
if [[ $BRANCH =~ ^([0-9]+)- ]]; then
60+
ISSUE="${BASH_REMATCH[1]}"
61+
echo "DEBUG: Extracted issue '$ISSUE' from branch name"
62+
else
63+
echo "DEBUG: Branch name did not match pattern ^([0-9]+)-"
64+
fi
5965
6066
# Fallback 1: Parse PR body for "Closes #X", "Fixes #X", "Resolves #X"
6167
if [ -z "$ISSUE" ]; then
@@ -83,15 +89,24 @@ runs:
8389
[ "$ISSUE" = "null" ] && ISSUE=""
8490
fi
8591
92+
echo "DEBUG: Final issue number is '$ISSUE'"
8693
echo "issue=$ISSUE" >> $GITHUB_OUTPUT
8794
8895
# Get changed files (gracefully handle permission errors)
8996
gh pr view ${{ inputs.pr_number }} --json files --jq '.files[].path' > .claude/review-context/changed.txt 2>/dev/null || touch .claude/review-context/changed.txt
9097
9198
# Get issue context if available
9299
if [ -n "$ISSUE" ]; then
93-
gh issue view $ISSUE --json title,body > .claude/review-context/issue.json 2>/dev/null || echo "{}" > .claude/review-context/issue.json
100+
echo "DEBUG: Fetching issue $ISSUE..."
101+
if gh issue view $ISSUE --json title,body > .claude/review-context/issue.json 2>&1; then
102+
echo "DEBUG: Issue fetch succeeded, content:"
103+
cat .claude/review-context/issue.json | head -c 200
104+
else
105+
echo "DEBUG: Issue fetch failed, using empty JSON"
106+
echo "{}" > .claude/review-context/issue.json
107+
fi
94108
else
109+
echo "DEBUG: No issue number, using empty JSON"
95110
echo "{}" > .claude/review-context/issue.json
96111
fi
97112

0 commit comments

Comments
 (0)