feat: add option to disable shims in PATH

Add `add_shims_to_path` input (default: true) to control whether the
mise shims directory is added to PATH. Setting this to false allows
users who already have mise configured to avoid conflicts with their
existing setup.

Fixes #337

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jdx 2025-12-16 08:43:17 -06:00
parent 4d93b33924
commit f90b26afa3
No known key found for this signature in database
GPG key ID: 584DADE86724B407
4 changed files with 37 additions and 30 deletions

View file

@ -67,6 +67,10 @@ inputs:
required: false
default: "false"
description: if true, will run `mise reshim --all` after setting up mise
add_shims_to_path:
required: false
default: "true"
description: if false, will not add mise shims directory to PATH
github_token:
required: false
description: |

53
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -187,9 +187,11 @@ async function setEnvVars(): Promise<void> {
set('MISE_TRUSTED_CONFIG_PATHS', process.cwd())
set('MISE_YES', '1')
const shimsDir = path.join(miseDir(), 'shims')
core.info(`Adding ${shimsDir} to PATH`)
core.addPath(shimsDir)
if (core.getBooleanInput('add_shims_to_path')) {
const shimsDir = path.join(miseDir(), 'shims')
core.info(`Adding ${shimsDir} to PATH`)
core.addPath(shimsDir)
}
}
async function restoreMiseCache(): Promise<string | undefined> {