From 93955bcc1bd87d59a4a2947ff1ec639e1502520d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 11 Sep 2026 17:06:29 +0000 Subject: [PATCH 1/2] Fix GitHub Actions workflow permissions and add error handling - Add pull-requests: write permission - Explicit GITHUB_TOKEN passing - Better logging and error handling - Improved response message Co-Authored-By: Claude Haiku 4.5 Claude-Session: https://claude.ai/code/session_01C5vwKNMUcG9R3aojrMhUwj --- .github/workflows/claude-issue-response.yml | 36 ++++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/claude-issue-response.yml b/.github/workflows/claude-issue-response.yml index bc8db68f..6fc44605 100644 --- a/.github/workflows/claude-issue-response.yml +++ b/.github/workflows/claude-issue-response.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest permissions: issues: write + pull-requests: write contents: read steps: @@ -27,31 +28,42 @@ jobs: - name: Respond to @claude mention if: steps.check_mention.outputs.mentioned == 'true' uses: actions/github-script@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + github-token: ${{ secrets.GITHUB_TOKEN }} script: | + console.log('Workflow triggered for @claude mention'); + console.log('Issue/PR number:', context.issue.number); + const issue_number = context.issue.number; const repo = context.repo.repo; const owner = context.repo.owner; const body = github.event.issue?.body || github.event.comment?.body || ''; + console.log('Body contains @claude:', body.includes('@claude')); // Create a response comment - github.rest.issues.createComment({ - owner: owner, - repo: repo, - issue_number: issue_number, - body: `👋 Hey! I see you've mentioned @claude. - -To get Claude to help with this issue, I'm setting up a workflow to process your request. Please wait a moment... + try { + const comment = await github.rest.issues.createComment({ + owner: owner, + repo: repo, + issue_number: issue_number, + body: `👋 Hey! I see you've mentioned @claude. -**Note**: The Claude GitHub App is installed and ready to help with: -- 🔍 Analyzing pull requests and issues +I'm here to help! The Claude GitHub App is installed and ready to assist with: +- 🔍 Analyzing code and issues - 🐛 Fixing CI errors -- 📝 Reviewing code changes +- 📝 Reviewing pull requests - 🤖 Responding to development tasks -Feel free to open a pull request or check back on this issue for updates!` - }); +Please describe what you need help with, and I'll get started!` + }); + console.log('Comment created successfully:', comment.data.id); + } catch (error) { + console.error('Error creating comment:', error); + throw error; + } - name: Log issue details if: steps.check_mention.outputs.mentioned == 'true' From 3972e6f46b853e8694e6f0f2192f3c4b45e3f136 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 11 Sep 2026 17:08:41 +0000 Subject: [PATCH 2/2] Fix YAML syntax error in workflow script - Replace template literal with escaped newlines - Remove backtick syntax that was causing YAML parse error Co-Authored-By: Claude Haiku 4.5 Claude-Session: https://claude.ai/code/session_01C5vwKNMUcG9R3aojrMhUwj --- .github/workflows/claude-issue-response.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/claude-issue-response.yml b/.github/workflows/claude-issue-response.yml index 6fc44605..1ec62505 100644 --- a/.github/workflows/claude-issue-response.yml +++ b/.github/workflows/claude-issue-response.yml @@ -28,8 +28,6 @@ jobs: - name: Respond to @claude mention if: steps.check_mention.outputs.mentioned == 'true' uses: actions/github-script@v7 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -43,21 +41,14 @@ jobs: const body = github.event.issue?.body || github.event.comment?.body || ''; console.log('Body contains @claude:', body.includes('@claude')); - // Create a response comment + const responseBody = '👋 Hey! I see you mentioned @claude.\n\nI am here to help! The Claude GitHub App is installed and ready to assist with:\n- 🔍 Analyzing code and issues\n- 🐛 Fixing CI errors\n- 📝 Reviewing pull requests\n- 🤖 Responding to development tasks\n\nPlease describe what you need help with, and I will get started!'; + try { const comment = await github.rest.issues.createComment({ owner: owner, repo: repo, issue_number: issue_number, - body: `👋 Hey! I see you've mentioned @claude. - -I'm here to help! The Claude GitHub App is installed and ready to assist with: -- 🔍 Analyzing code and issues -- 🐛 Fixing CI errors -- 📝 Reviewing pull requests -- 🤖 Responding to development tasks - -Please describe what you need help with, and I'll get started!` + body: responseBody }); console.log('Comment created successfully:', comment.data.id); } catch (error) {