mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 14:24:13 +08:00
fix: respect user's --setting-sources in claude_args (#750)
When users specify --setting-sources in claude_args (e.g., '--setting-sources user'), the action now respects that value instead of overriding it with all three sources. This fixes an issue where users who wanted to avoid in-repo configs would still have them loaded because the settingSources was hardcoded to ['user', 'project', 'local']. Fixes #749 Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
This commit is contained in:
@@ -249,10 +249,18 @@ export function parseSdkOptions(options: ClaudeOptions): ParsedSdkOptions {
|
|||||||
extraArgs,
|
extraArgs,
|
||||||
env,
|
env,
|
||||||
|
|
||||||
// Load settings from all sources to pick up CLI-installed plugins, CLAUDE.md, etc.
|
// Load settings from sources - prefer user's --setting-sources if provided, otherwise use all sources
|
||||||
settingSources: ["user", "project", "local"],
|
// This ensures users can override the default behavior (e.g., --setting-sources user to avoid in-repo configs)
|
||||||
|
settingSources: extraArgs["setting-sources"]
|
||||||
|
? (extraArgs["setting-sources"].split(
|
||||||
|
",",
|
||||||
|
) as SdkOptions["settingSources"])
|
||||||
|
: ["user", "project", "local"],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Remove setting-sources from extraArgs to avoid passing it twice
|
||||||
|
delete extraArgs["setting-sources"];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sdkOptions,
|
sdkOptions,
|
||||||
showFullOutput,
|
showFullOutput,
|
||||||
|
|||||||
Reference in New Issue
Block a user