Skip to content

Commit 20bfb6e

Browse files
authored
Session work\n\nAuto-commit at session end to preserve work in progress.\n\nSession-ID: 8a36e6e7-29fa-442e-b5e1-cbca287395df\nSession-Timestamp: 2026-01-31T08:03:54.491Z\nBranch: 76-feature/please-investigate-while-all-agent-revie\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> (#77)
1 parent 88ba670 commit 20bfb6e

3 files changed

Lines changed: 38 additions & 10 deletions

File tree

.github/actions/code-quality-reviewer/action.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ runs:
4242
GITHUB_TOKEN: ${{ inputs.github_token }}
4343
run: |
4444
mkdir -p .claude/review-context
45-
# Gracefully handle permission errors
46-
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
45+
# Get changed files — capture errors instead of suppressing them
46+
if ! gh pr view ${{ inputs.pr_number }} --json files --jq '.files[].path' > .claude/review-context/changed.txt 2>/tmp/gh-error.log; then
47+
echo "::warning::Failed to fetch PR files. Check that the workflow has 'pull-requests: read' permission."
48+
cat /tmp/gh-error.log >&2
49+
touch .claude/review-context/changed.txt
50+
fi
4751
4852
- name: Validate context
4953
id: validate
@@ -53,7 +57,11 @@ runs:
5357
SKIP_REASON=""
5458
if [ ! -s ".claude/review-context/changed.txt" ]; then
5559
SKIP="true"
56-
SKIP_REASON="No changed files found or unable to access PR data"
60+
if [ -f /tmp/gh-error.log ] && grep -qi "403\|forbidden\|permission\|Resource not accessible" /tmp/gh-error.log; then
61+
SKIP_REASON="Missing 'pull-requests: read' permission — add it to workflow permissions block"
62+
else
63+
SKIP_REASON="No changed files found or unable to access PR data"
64+
fi
5765
fi
5866
echo "skip=$SKIP" >> $GITHUB_OUTPUT
5967
echo "skip_reason=$SKIP_REASON" >> $GITHUB_OUTPUT

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,28 @@ runs:
4747
run: |
4848
mkdir -p .claude/review-context
4949
50-
# Get changed files
51-
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
50+
# Get changed files — capture errors instead of suppressing them
51+
if ! gh pr view ${{ inputs.pr_number }} --json files --jq '.files[].path' > .claude/review-context/changed.txt 2>/tmp/gh-error.log; then
52+
echo "::warning::Failed to fetch PR files. Check that the workflow has 'pull-requests: read' permission."
53+
cat /tmp/gh-error.log >&2
54+
touch .claude/review-context/changed.txt
55+
fi
5256
5357
# Get PR details
54-
gh pr view ${{ inputs.pr_number }} --json title,body,author > .claude/review-context/pr.json 2>/dev/null || echo '{}' > .claude/review-context/pr.json
58+
if ! gh pr view ${{ inputs.pr_number }} --json title,body,author > .claude/review-context/pr.json 2>/tmp/gh-pr-error.log; then
59+
echo "::warning::Failed to fetch PR details. Check that the workflow has 'pull-requests: read' permission."
60+
cat /tmp/gh-pr-error.log >&2
61+
echo '{}' > .claude/review-context/pr.json
62+
fi
5563
5664
# Check if we have context
5765
if [ ! -s ".claude/review-context/changed.txt" ]; then
5866
echo "skip=true" >> $GITHUB_OUTPUT
59-
echo "skip_reason=No changed files found" >> $GITHUB_OUTPUT
67+
if [ -f /tmp/gh-error.log ] && grep -qi "403\|forbidden\|permission\|Resource not accessible" /tmp/gh-error.log; then
68+
echo "skip_reason=Missing 'pull-requests: read' permission — add it to workflow permissions block" >> $GITHUB_OUTPUT
69+
else
70+
echo "skip_reason=No changed files found or unable to access PR data" >> $GITHUB_OUTPUT
71+
fi
6072
else
6173
echo "skip=false" >> $GITHUB_OUTPUT
6274
fi

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ runs:
9191
9292
echo "issue=$ISSUE" >> $GITHUB_OUTPUT
9393
94-
# Get changed files (gracefully handle permission errors)
95-
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
94+
# Get changed files — capture errors instead of suppressing them
95+
if ! gh pr view ${{ inputs.pr_number }} --json files --jq '.files[].path' > .claude/review-context/changed.txt 2>/tmp/gh-error.log; then
96+
echo "::warning::Failed to fetch PR files. Check that the workflow has 'pull-requests: read' permission."
97+
cat /tmp/gh-error.log >&2
98+
touch .claude/review-context/changed.txt
99+
fi
96100
97101
# Get issue context if available
98102
if [ -n "$ISSUE" ]; then
@@ -116,7 +120,11 @@ runs:
116120
# Check if changed files exist and have content
117121
if [ ! -s ".claude/review-context/changed.txt" ]; then
118122
SKIP="true"
119-
SKIP_REASON="No changed files found or unable to access PR data"
123+
if [ -f /tmp/gh-error.log ] && grep -qi "403\|forbidden\|permission\|Resource not accessible" /tmp/gh-error.log; then
124+
SKIP_REASON="Missing 'pull-requests: read' permission — add it to workflow permissions block"
125+
else
126+
SKIP_REASON="No changed files found or unable to access PR data"
127+
fi
120128
fi
121129
122130
# Check if issue context has actual content (not just {})

0 commit comments

Comments
 (0)