GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@ashwin-ant

@ashwin-ant ashwin-ant commented May 31, 2025

Copy link
Copy Markdown
Collaborator

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.

All reactions
@claude

claude Bot commented May 31, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  1. Proper Input Definition (action.yml:42-45): The input follows GitHub Actions conventions with appropriate description, required flag, and default value.

  2. Correct Integration (action.yml:116): The input is properly passed to the claude-code-base-action step, maintaining the action's modular architecture.

  3. Good Documentation: The description clearly explains the purpose and format (YAML).

  4. 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

  1. 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')"
  2. 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ashwin-ant

ashwin-ant commented May 31, 2025

Copy link
Copy Markdown
Collaborator Author

@claude add it to the readme with a clear example of the syntax

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@claude

claude Bot commented May 31, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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:

  1. Inputs Table Entry (README.md:87): Added claude_env to the inputs table with a clear description
  2. Basic Example (README.md:68-72): Added a commented example in the basic workflow configuration showing the YAML syntax
  3. 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced May 31, 2025
Feature Request: Support for passing custom environment variables to Claude Code execution #101
Closed
Comments in (forked) PR trigger claude-code-action with wrong branch #46
Open
@ashwin-ant
ashwin-ant force-pushed the claude/issue-101-20250531_001023 branch from 5dcacc0 to 43dfa32 Compare June 2, 2025 15:47
ltawfik
ltawfik previously approved these changes Jun 3, 2025
View reviewed changes
claude Bot and others added 2 commits June 2, 2025 20:49
@claude @ashwin-ant
feat: add claude_env input for custom environment variables
39c280b
Co-authored-by: ashwin-ant <[email protected]>
@claude @ashwin-ant
docs: add claude_env input documentation with clear syntax examples
853107d
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]>
@ashwin-ant
ashwin-ant dismissed ltawfik’s stale review via 853107d June 3, 2025 03:49
@ashwin-ant
ashwin-ant force-pushed the claude/issue-101-20250531_001023 branch from 43dfa32 to 853107d Compare June 3, 2025 03:49
@ashwin-ant
ashwin-ant enabled auto-merge (squash) June 3, 2025 03:52
ltawfik
ltawfik approved these changes Jun 3, 2025
View reviewed changes
@ashwin-ant
ashwin-ant merged commit 70245e5 into main Jun 3, 2025
@claude claude Bot mentioned this pull request Jun 12, 2026
Add pr-stamp-sweep review workflow #1409
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jul 6, 2026
ci: authenticate gh in claude-implement so the loop opens its PR allxsmith/bestax#219
Merged
5 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ltawfik ltawfik ltawfik approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for passing custom environment variables to Claude Code execution

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ashwin-ant @ltawfik
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.