fix: add CLAUDE_WORKING_DIR support to main action#994
Open
TomokiIchi wants to merge 1 commit intoanthropics:mainfrom
Open
fix: add CLAUDE_WORKING_DIR support to main action#994TomokiIchi wants to merge 1 commit intoanthropics:mainfrom
TomokiIchi wants to merge 1 commit intoanthropics:mainfrom
Conversation
The base-action already supports CLAUDE_WORKING_DIR to change the working directory before running Claude Code, but the main action (action.yml) was missing this feature after the refactor in anthropics#285. This adds the same cd logic to the main action's run step, enabling monorepo users to set CLAUDE_WORKING_DIR to run Claude Code in a subdirectory. Fixes anthropics#315 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Hello! Thank you for maintaining this project. Thank you for your time and for this awesome project! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CLAUDE_WORKING_DIRenvironment variable support to the main composite action (action.yml)base-action/action.ymlalready has this feature (L156-160), but the main action was missing it after the refactor in feat: integrate claude-code-base-action as local subaction #285CLAUDE_WORKING_DIRandcds to it before running the entrypointMotivation
Monorepo users need to run Claude Code in a subdirectory (e.g.,
systems/journeywithin a larger repo). TheCLAUDE_WORKING_DIRenvironment variable was designed for this, but currently only works withclaude-code-base-action, not the mainclaude-code-action.This causes Claude Code to:
.claude/configurations (CLAUDE.md, settings, skills)cdinstructionsChanges
Added the same
CLAUDE_WORKING_DIRcheck frombase-action/action.ymlto the mainaction.yml:The guard (
if [ -n ... ]) ensures no behavior change when the variable is not set.Usage
Fixes #315