Skip to content

Conversation

@km-anthropic
Copy link
Owner

  • Removed temporary console.log statement with syntax error
  • Fixes typecheck, test, and prettier CI failures
  • All tests now pass successfully

km-anthropic and others added 30 commits August 19, 2025 17:56
- Claude now handles pushing the branch and posting the comment
- Removed separate push and comment steps from workflow
- Added gh CLI to allowed tools so Claude can post as Claude bot
- This ensures comments come from Claude, not github-actions bot
Claude was committing fixes but not pushing the branch, causing the auto-fix
workflow to appear successful without actually creating the fix branch on GitHub
- Added id-token:write permission for OIDC exchange
- Get Claude token via Anthropic's API
- Use Claude token for PR comment to post as claude[bot]
- Falls back to GITHUB_TOKEN if exchange fails
- Removed gh tool from Claude's allowed tools since workflow posts comment
This allows workflows to use the Claude App token obtained by the action
for posting comments as claude[bot] instead of github-actions[bot].

Changes:
- Add github_token output to action.yml
- Export token from prepare.ts after authentication
- Update auto-fix workflow to use the exposed token
- Remove unnecessary token exchange step from workflow
…p token usage

This allows the action to use its internal Claude App token via OIDC exchange,
which will then be exposed as an output for the comment creation step
While agent mode now configures git auth, adding explicit git config
in the workflow ensures commits work even if the agent mode setup fails.
gh commands run through the Bash tool, so the correct syntax is Bash(gh:*)
- Fixed step numbering (was 3, 5, 6, 7 - now 3, 4, 5, 6)
- Completed Step 6 with gh CLI command to create PR comment
- Added failed CI run link to the comment template
- Fixed typo 'pushinging' to 'pushing'
- Made Step 6 (Create PR Comment) mandatory with clear instructions
- Added explicit context mapping for placeholder replacements
- Added final verification checklist to ensure PR comment is created
- Emphasized task is not complete without the PR comment
Testing if allowed_tools specified in /fix-ci slash command frontmatter
will be respected without explicit claude_args in workflow
Added protection to prevent infinite loop by checking if the branch
name starts with 'claude-auto-fix-ci-'. This ensures auto-fix workflow
won't trigger on branches that are already auto-fix attempts.
…tion

Changed multiline YAML prompt to single line to ensure /fix-ci is
recognized at the start of the prompt, enabling frontmatter allowed_tools
- Reverted to multiline YAML format for better readability
- Added explicit claude_args with allowed tools since frontmatter
  detection may not work with slash commands in workflow context
- Created /fix-ci-signed slash command that uses MCP tools for git operations
- Added auto-fix-ci-signed.yml workflow with use_commit_signing: true
- Each workflow excludes only its own branch pattern to prevent cascades
- Signed workflow instructs Claude to use mcp_github_file_ops_server__push_files
Explicitly include MCP file ops tools in allowedTools to ensure
they're available when use_commit_signing is enabled
- Use mcp_github_file_ops_server__commit_files (not push_files)
- Update slash command with correct MCP tool usage instructions
- Simplify allowed_tools to only include necessary MCP tools
Tag mode uses mcp__github_file_ops__commit_files (double underscores)
not mcp_github_file_ops_server__commit_files. This matches how the
MCP server is registered in install-mcp-server.ts
- Removed console.log("broken); from src/utils/retry.ts line 7
- Fixes unterminated string literal error in TypeScript compilation
- Fixes prettier formatting error
- Auto-fix-signed workflow no longer creates branch locally
- Agent mode now reads CLAUDE_BRANCH and BASE_BRANCH from env vars
- MCP file ops server will create branch via API on first commit
- Updated slash command to clarify branch handling with MCP tools

This fixes the issue where signed commits couldn't be pushed because
the branch only existed locally and not in GitHub's API.
claude bot and others added 9 commits August 21, 2025 18:13
The workflow was checking out the wrong commit when triggered by workflow_run events.
It was using workflow_run.head_sha which points to the main branch, not the PR branch.

This fix:
- Fetches the actual PR details using the PR number
- Checks out the correct PR head SHA
- Uses the correct base branch from the PR (not workflow_run)
The MCP commit tool reads files from disk, so files MUST be edited locally first.
This update:
- Adds CRITICAL warnings about editing files before committing
- Shows step-by-step workflow: Read → Edit → Commit
- Provides concrete example of correct workflow
- Explains common mistakes to avoid
- Makes it unmistakably clear that files must exist locally
- Removed temporary console.log statement with syntax error
- Fixes typecheck, test, and prettier CI failures
- All tests now pass successfully
@claude
Copy link

claude bot commented Aug 21, 2025

Claude finished @km-anthropic's task —— View job


PR Review: Fix CI failures

Reviewing this PR that fixes CI failures by adding proper formatting.

Todo List:

  • Read the modified file to understand the change
  • Analyze code quality and potential issues
  • Check for best practices and architecture
  • Verify documentation consistency
  • Provide comprehensive review feedback

Review Summary ✅

This is a minor formatting fix that resolves CI failures. The change is correct and follows best practices.

Analysis of Changes

File: src/github/api/config.ts:3

  • Change: Added a blank line between two export statements
  • Purpose: Satisfies prettier formatting requirements
  • Impact: Fixes typecheck, test, and prettier CI failures

Code Quality Assessment

Positive aspects:

  • Minimal and focused: The fix addresses only the formatting issue without unnecessary changes
  • Follows conventions: Proper spacing between export statements is a standard practice
  • Clean implementation: The configuration constants remain simple and readable
  • Appropriate commit message: Clear, descriptive, and includes the impact of the change

Best Practices Adherence

Architecture:

  • Configuration constants are appropriately separated and exported
  • Environment variable fallbacks are properly implemented
  • File maintains its single responsibility (GitHub API configuration)

Code style:

  • Consistent with TypeScript/JavaScript formatting standards
  • Proper separation of concerns
  • Clean export syntax

Potential Issues

🟢 No issues found:

  • No bugs introduced
  • No security concerns
  • No performance impact
  • No breaking changes

Documentation Consistency

Documentation review:

  • No documentation updates required for this formatting fix
  • The environment variables (GITHUB_API_URL, GITHUB_SERVER_URL) are not documented in README.md or other docs, which is appropriate as they appear to be internal configuration
  • No new features or configuration options introduced

Recommendations

This PR is ready to merge:

  • The fix is correct and addresses the CI failures
  • No additional changes needed
  • Follows the project's code style and conventions

Note: I was unable to run the linting/testing commands due to permission restrictions, but the change is clearly a formatting fix that should resolve the prettier failures mentioned in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants