Skip to content

chore: Add Claude Code GitHub Workflow#1

Merged
kdy1 merged 1 commit intomainfrom
add-claude-github-actions-1761129495099
Oct 22, 2025
Merged

chore: Add Claude Code GitHub Workflow#1
kdy1 merged 1 commit intomainfrom
add-claude-github-actions-1761129495099

Conversation

@kdy1
Copy link
Owner

@kdy1 kdy1 commented Oct 22, 2025

🤖 Installing Claude Code GitHub App

This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.

What is Claude Code?

Claude Code is an AI coding agent that can help with:

  • Bug fixes and improvements
  • Documentation updates
  • Implementing new features
  • Code reviews and suggestions
  • Writing tests
  • And more!

How it works

Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.

Important Notes

  • This workflow won't take effect until this PR is merged
  • @claude mentions won't work until after the merge is complete
  • The workflow runs automatically whenever Claude is mentioned in PR or issue comments
  • Claude gets access to the entire PR or issue context including files, diffs, and previous comments

Security

  • Our Anthropic API key is securely stored as a GitHub Actions secret
  • Only users with write access to the repository can trigger the workflow
  • All Claude runs are stored in the GitHub Actions run history
  • Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
  • We can add more allowed tools by adding them to the workflow file like:
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)

There's more information in the Claude Code action repo.

After merging this PR, let's try mentioning @claude in a comment on any PR to get started!

@kdy1 kdy1 merged commit 4764c86 into main Oct 22, 2025
15 checks passed
@kdy1 kdy1 deleted the add-claude-github-actions-1761129495099 branch October 22, 2025 10:39
@claude
Copy link

claude bot commented Oct 22, 2025

Code Review: Claude Code GitHub Workflow

Thank you for adding Claude Code integration! This is a well-structured workflow file.

Strengths

  1. Security: Good permission scoping with minimal required permissions
  2. Documentation: Excellent PR description
  3. Clean Structure: Well-organized YAML with helpful comments
  4. Tool Restrictions: Properly limits Claude's tools to read-only GitHub operations

Code Quality

  • Uses latest actions/checkout@v4
  • fetch-depth: 1 for performance optimization
  • Clear separation of concerns in the prompt

Security Considerations

Strong Points:

  • Uses secret for CLAUDE_CODE_OAUTH_TOKEN
  • Restricted tool permissions
  • contents: read prevents unauthorized writes
  • id-token: write for OIDC authentication

Recommendations:

  1. Consider adding branch protection for initial rollout
  2. Document secret rotation process
  3. Consider rate limiting for high-traffic repos

Potential Issues

  1. Missing reopened trigger - consider adding if needed
  2. No timeout specified - consider adding timeout-minutes: 10
  3. No concurrency control - multiple commits could trigger parallel reviews

Recommendations

  • Add concurrency control to prevent redundant runs
  • Set a timeout to prevent runaway jobs
  • Consider path filtering for performance
  • Pin to specific version instead of @v1

Summary

This is a well-implemented workflow that safely integrates Claude Code. The workflow is production-ready as-is, with the suggestions being optimizations rather than critical fixes.

Recommendation: Approve with minor suggestions


Review generated by Claude Code

@github-actions
Copy link

📦 Binary Size-limit

Comparing 566b456 to chore: release 1.6.0-beta.1 (#11962) by Fy

🙈 Size remains the same at 47.82MB

kdy1 added a commit that referenced this pull request Oct 22, 2025
kdy1 added a commit that referenced this pull request Jan 14, 2026
…eb-infra-dev#11978)

* chore: Add Claude Code GitHub Workflow (#1)

## 🤖 Installing Claude Code GitHub App

This PR adds a GitHub Actions workflow that enables Claude Code
integration in our repository.

### What is Claude Code?

[Claude Code](https://claude.com/claude-code) is an AI coding agent that
can help with:
- Bug fixes and improvements  
- Documentation updates
- Implementing new features
- Code reviews and suggestions
- Writing tests
- And more!

### How it works

Once this PR is merged, we'll be able to interact with Claude by
mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and
surrounding context, and execute on the request in a GitHub action.

### Important Notes

- **This workflow won't take effect until this PR is merged**
- **@claude mentions won't work until after the merge is complete**
- The workflow runs automatically whenever Claude is mentioned in PR or
issue comments
- Claude gets access to the entire PR or issue context including files,
diffs, and previous comments

### Security

- Our Anthropic API key is securely stored as a GitHub Actions secret
- Only users with write access to the repository can trigger the
workflow
- All Claude runs are stored in the GitHub Actions run history
- Claude's default tools are limited to reading/writing files and
interacting with our repo by creating comments, branches, and commits.
- We can add more allowed tools by adding them to the workflow file
like:

```
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
```

There's more information in the [Claude Code action
repo](https://github.com/anthropics/claude-code-action).

After merging this PR, let's try mentioning @claude in a comment on any
PR to get started!

* chore: Configure autodev

* refactor(core): Convert BoxModule from type alias to newtype struct (#2)

## Summary
This PR refactors `BoxModule` from a simple type alias to a newtype
struct pattern for improved type safety and better encapsulation while
maintaining all existing functionality.

## Objective
Refactor `BoxModule` in `crates/rspack_core/src/module.rs` from a type
alias to a newtype struct pattern. This change improves type safety and
provides better encapsulation while maintaining all existing
functionality.

## Current Implementation
Previously, `BoxModule` was defined as:
```rust
pub type BoxModule = Box<dyn Module>;
```

## New Implementation
Now `BoxModule` is a newtype struct:
```rust
#[cacheable(with=AsInner)]
#[repr(transparent)]
pub struct BoxModule(Box<dyn Module>);
```

## Changes Made

### Core Module (`crates/rspack_core/src/module.rs`)
- Converted `BoxModule` from type alias to newtype struct
- Implemented essential traits:
- **Deref/DerefMut**: Allow transparent access to `Box<dyn Module>`
methods
  - **From<Box<dyn Module>>**: Enable ergonomic construction
  - **AsRef/AsMut**: Provide reference conversions
  - **Debug**: Forward to inner type's Debug implementation
  - **Identifiable**: Forward to inner module's identifier method
  - **AsInnerConverter**: Enable cacheable serialization support
- Added `BoxModule::new()` constructor method
- Updated `ModuleExt::boxed()` to return `BoxModule`

### Compilation & Module Management
- Updated `BuildTask` and `AddTask` to use `BoxModule`
- Fixed type conversions across module factories
- Updated module graph operations for proper deref coercion

### Plugin Updates (19 files changed)
- **rspack_plugin_devtool**: Fixed borrow checker issues
- **rspack_plugin_dll**: Updated DLL and delegated module factories
- **rspack_plugin_extract_css**: Updated CSS module factory
- **rspack_plugin_javascript**: Fixed ESM dependency checks
- **rspack_plugin_lazy_compilation**: Updated proxy module creation
- **rspack_plugin_mf**: Updated container and sharing module factories
- **rspack_plugin_split_chunks**: Fixed module reference handling

## Benefits
- **Type Safety**: Prevents accidental mixing with other boxed types
- **Better Encapsulation**: Private inner field with clear API boundary
- **Zero-Cost Abstraction**: `#[repr(transparent)]` ensures no runtime
overhead
- **Improved Maintainability**: Single, well-defined interface for
module boxing

## Compatibility
- All existing code continues to work due to `Deref` coercion
- The `.boxed()` helper provides ergonomic module creation
- Cacheable serialization works seamlessly

## Testing
- [x] `cargo check --workspace` passes without errors
- [ ] `cargo test --workspace` (pending)
- [x] All type conversions compile correctly
- [x] Deref coercion works as expected

## References
- Rust newtype pattern:
https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html
- Rust Book - Advanced Types:
https://doc.rust-lang.org/book/ch19-04-advanced-types.html
- Effective Rust - Newtype Pattern:
https://www.lurklurk.org/effective-rust/newtype.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Revert "chore: Configure autodev"

This reverts commit ae36c58.

* Revert "chore: Add Claude Code GitHub Workflow (#1)"

This reverts commit 4764c86.

---------

Co-authored-by: delino[bot] <235003666+delino[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant