diff --git a/action.yml b/action.yml index 2e3388c25..062db5026 100644 --- a/action.yml +++ b/action.yml @@ -142,6 +142,10 @@ inputs: description: "Show full JSON output from Claude Code. WARNING: This outputs ALL Claude messages including tool execution results which may contain secrets, API keys, or other sensitive information. These logs are publicly visible in GitHub Actions. Only enable for debugging in non-sensitive environments." required: false default: "false" + npmrc_config: + description: "Content to write to ~/.npmrc before installing dependencies. Useful for configuring private npm registries in air-gapped or enterprise environments." + required: false + default: "" plugins: description: "Newline-separated list of Claude Code plugin names to install (e.g., 'code-review@claude-code-plugins\nfeature-dev@claude-code-plugins')" required: false @@ -280,6 +284,7 @@ runs: INPUT_PATH_TO_BUN_EXECUTABLE: ${{ inputs.path_to_bun_executable }} INPUT_SHOW_FULL_OUTPUT: ${{ inputs.show_full_output }} DISPLAY_REPORT: ${{ inputs.display_report }} + INPUT_NPMRC_CONFIG: ${{ inputs.npmrc_config }} INPUT_PLUGINS: ${{ inputs.plugins }} INPUT_PLUGIN_MARKETPLACES: ${{ inputs.plugin_marketplaces }} PATH_TO_CLAUDE_CODE_EXECUTABLE: ${{ inputs.path_to_claude_code_executable }} diff --git a/src/entrypoints/run.ts b/src/entrypoints/run.ts index 4bfdddf14..30683dd73 100644 --- a/src/entrypoints/run.ts +++ b/src/entrypoints/run.ts @@ -219,6 +219,13 @@ async function run() { baseBranch = prepareResult.branchInfo.baseBranch; prepareCompleted = true; + // Write .npmrc if configured (for air-gapped / enterprise environments) + if (process.env.INPUT_NPMRC_CONFIG) { + const npmrcPath = `${process.env.HOME}/.npmrc`; + await appendFile(npmrcPath, `\n${process.env.INPUT_NPMRC_CONFIG}\n`); + console.log("Wrote custom .npmrc configuration"); + } + // Phase 2: Install Claude Code CLI await installClaudeCode();