GeezerVison is showing github.com — feat: add claude_env input for custom environment variables by ashwin-ant · Pull Request #102 · anthropics/claude-code-action
Conversation
Adds support for passing custom environment variables to Claude Code execution through a new claude_env input.
This allows users to pass environment variables required for their CI test setup or other commands.
Closes #101
Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
claude
Bot
commented
May 31, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Claude finished @ashwin-ant's task —— View job
PR Review: Add claude_env input for custom environment variables
Todo List:
- Read and analyze action.yml changes
- Review implementation for best practices
- Check GitHub Actions conventions
- Provide comprehensive feedback
Review Summary
This PR adds a new claude_env input to allow passing custom environment variables to Claude Code execution. The implementation is clean and well-integrated.
✅ Positive Aspects
-
Proper Input Definition (action.yml:42-45): The input follows GitHub Actions conventions with appropriate description, required flag, and default value.
-
Correct Integration (action.yml:116): The input is properly passed to the claude-code-base-action step, maintaining the action's modular architecture.
-
Good Documentation: The description clearly explains the purpose and format (YAML).
-
Consistent Placement: The input is logically grouped with other Claude Code configuration inputs.
🔍 Technical Analysis
Code Quality: ✅ Excellent
- Follows existing patterns and conventions
- Maintains consistency with other inputs
- No syntax or structural issues
Security Considerations: ✅ Good
- Environment variables are passed through the established claude-code-base-action, which should handle them securely
- No direct exposure of sensitive data in the action definition
Architecture: ✅ Well-designed
- Leverages existing infrastructure rather than reinventing
- Maintains separation of concerns
- Follows the action's delegation pattern
📝 Minor Suggestions
-
Documentation Enhancement: Consider adding an example in the description:
claude_env:
description: "Custom environment variables to pass to Claude Code execution (YAML format, e.g., 'NODE_ENV: test\nDEBUG: true')"
-
Future Consideration: The YAML format requirement might benefit from validation in the base action to provide better error messages for malformed input.
🎯 Overall Assessment
This is a high-quality, straightforward addition that:
- ✅ Solves a real need (custom env vars for CI/test setups)
- ✅ Integrates seamlessly with existing architecture
- ✅ Follows all GitHub Actions best practices
- ✅ Maintains backward compatibility
- ✅ Has appropriate documentation
Recommendation: ✅ APPROVE - Ready to merge. This is a well-implemented feature that adds valuable functionality without any architectural concerns.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@claude add it to the readme with a clear example of the syntax
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
claude
Bot
commented
May 31, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Claude finished @ashwin-ant's task —— View job
Todo List:
- Read README.md to understand structure
- Add documentation for
claude_env input with clear syntax example
- Commit and push changes to PR branch
Summary
I've successfully added documentation for the claude_env input to the README.md with:
- Inputs Table Entry (
README.md:87): Added claude_env to the inputs table with a clear description
- Basic Example (
README.md:68-72): Added a commented example in the basic workflow configuration showing the YAML syntax
- Advanced Configuration Section (
README.md:242-257): Added a detailed section explaining the feature with a practical example showing various environment variable use cases
The documentation clearly shows:
- The YAML format requirement
- Multiple practical examples (NODE_ENV, CI, DATABASE_URL, API_KEY)
- The use case for CI/test setups
This makes it easy for users to understand how to pass custom environment variables to Claude Code execution.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced May 31, 2025
Added comprehensive documentation for the new claude_env input including:
- Entry in the Inputs table with description
- Example in the basic workflow configuration
- Detailed section in Advanced Configuration with practical use cases
This makes it clear how users can pass custom environment variables
to Claude Code execution in YAML format for CI/test setups.
Co-authored-by: ashwin-ant <[email protected]>
Reviewers
ltawfik
ltawfik approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|