-
Notifications
You must be signed in to change notification settings - Fork 0
fix: specify ref, add timeout and continue-on-error #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,7 @@ jobs: | |||||
| # TODO: remove author filter after testing is complete | ||||||
| if: github.event.pull_request.draft == false && github.event.pull_request.user.login == 'zfarrell' | ||||||
| runs-on: ubuntu-latest | ||||||
| timeout-minutes: 15 | ||||||
| permissions: | ||||||
| contents: read | ||||||
| pull-requests: write | ||||||
|
|
@@ -29,6 +30,7 @@ jobs: | |||||
| - uses: actions/checkout@v4 | ||||||
| with: | ||||||
| repository: hotdata-dev/github-workflows | ||||||
| ref: main | ||||||
| token: ${{ steps.app-token.outputs.token }} | ||||||
| path: .github-workflows | ||||||
| sparse-checkout: docs/claude-pr-review-prompt.md | ||||||
|
|
@@ -43,6 +45,8 @@ jobs: | |||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||
|
|
||||||
| - uses: anthropics/claude-code-action@v1 | ||||||
| id: review | ||||||
| continue-on-error: true | ||||||
| with: | ||||||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||||||
| track_progress: false | ||||||
|
|
@@ -53,3 +57,9 @@ jobs: | |||||
| ${{ steps.prompt.outputs.content }} | ||||||
| claude_args: | | ||||||
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review:*),Read" | ||||||
|
|
||||||
| - name: Notify on review failure | ||||||
| if: steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled' | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The To actually catch the cancellation case:
Suggested change
|
||||||
| run: gh pr comment ${{ github.event.pull_request.number }} --body "Automated review unavailable (Claude step failed). Please review manually." | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: prefer passing the PR number via an env var rather than interpolating it inline into the shell command.
Suggested change
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }} |
||||||
| env: | ||||||
| GH_TOKEN: ${{ github.token }} | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With
continue-on-error: true, failures in the Claude step are silently swallowed — an expired API key or persistent outage would stop reviews from happening with no signal to the team. Consider adding a follow-up step that posts a PR comment when this step fails:Non-blocking suggestion — the resilience intent is sound.