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:
Yousif Akbar 2023-08-18 11:29:16 -04:00 committed by GitHub
parent 43ea57b96e
commit 10114e7e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 2 deletions

View file

@ -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`)