mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-15 06:10:32 +00:00
Adding Setting of Necessary Environment Variables Before Running rtx (#123)
* Fixing typo in outputs of action.yml * Adding `setEnvVars` step for env vars that should always be set in the action
This commit is contained in:
parent
43ea57b96e
commit
10114e7e8a
4 changed files with 24 additions and 2 deletions
13
src/main.ts
13
src/main.ts
|
|
@ -11,11 +11,24 @@ async function run(): Promise<void> {
|
|||
await setToolVersions()
|
||||
await restoreRTXCache()
|
||||
await setupRTX()
|
||||
await setEnvVars()
|
||||
await exec.exec('rtx', ['--version'])
|
||||
await exec.exec('rtx', ['install'])
|
||||
await setPaths()
|
||||
}
|
||||
|
||||
async function setEnvVars(): Promise<void> {
|
||||
if (!process.env['RTX_TRUSTED_CONFIG_PATHS']) {
|
||||
core.exportVariable(
|
||||
'RTX_TRUSTED_CONFIG_PATHS',
|
||||
path.join(process.cwd(), '.rtx.toml')
|
||||
)
|
||||
}
|
||||
if (!process.env['RTX_YES']) {
|
||||
core.exportVariable('RTX_YES', 'yes')
|
||||
}
|
||||
}
|
||||
|
||||
async function restoreRTXCache(): Promise<void> {
|
||||
const cachePath = rtxDir()
|
||||
const fileHash = await glob.hashFiles(`**/.tool-versions\n**/.rtx.toml`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue