diff --git a/.rtx.toml b/.rtx.toml new file mode 100644 index 0000000..ccc8bd0 --- /dev/null +++ b/.rtx.toml @@ -0,0 +1,2 @@ +[tools] +node = '20.10.0' \ No newline at end of file diff --git a/README.md b/README.md index 0c4a0f5..72e522d 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ jobs: install: true # [default: true] run `rtx install` cache: true # [default: true] cache rtx using GitHub's cache # automatically write this .tool-versions file + experimental: true # [default: false] enable experimental features tool_versions: | shellcheck 0.9.0 # or, if you prefer .rtx.toml format: diff --git a/action.yml b/action.yml index d968b04..d30820a 100644 --- a/action.yml +++ b/action.yml @@ -40,6 +40,10 @@ inputs: required: false default: "rtx-v0" description: The prefix key to use for the cache, change this to invalidate the cache + experimental: + required: false + default: "false" + description: if true, will use experimental features outputs: cache-hit: description: A boolean value to indicate if a cache was hit. diff --git a/dist/index.js b/dist/index.js index 7b23719..a8842a6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -82964,6 +82964,7 @@ async function setEnvVars() { }; set('RTX_TRUSTED_CONFIG_PATHS', process.cwd()); set('RTX_YES', '1'); + set('RTX_EXPERIMENTAL', getExperimental() ? '1' : '0'); const shimsDir = path.join((0, utils_1.rtxDir)(), 'shims'); core.info(`Adding ${shimsDir} to PATH`); core.addPath(shimsDir); @@ -83002,6 +83003,10 @@ async function setupRTX(version) { await exec.exec('chmod', ['+x', path.join(rtxBinDir, 'rtx')]); core.addPath(rtxBinDir); } +function getExperimental() { + const experimentalString = core.getInput('experimental'); + return experimentalString === 'true' ? true : false; +} async function setToolVersions() { const toolVersions = core.getInput('tool_versions'); if (toolVersions) { diff --git a/src/index.ts b/src/index.ts index 6568f96..3b74654 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,6 +41,7 @@ async function setEnvVars(): Promise { } set('RTX_TRUSTED_CONFIG_PATHS', process.cwd()) set('RTX_YES', '1') + set('RTX_EXPERIMENTAL', getExperimental() ? '1' : '0') const shimsDir = path.join(rtxDir(), 'shims') core.info(`Adding ${shimsDir} to PATH`) @@ -87,6 +88,11 @@ async function setupRTX(version: string | undefined): Promise { core.addPath(rtxBinDir) } +function getExperimental(): boolean { + const experimentalString = core.getInput('experimental') + return experimentalString === 'true' ? true : false +} + async function setToolVersions(): Promise { const toolVersions = core.getInput('tool_versions') if (toolVersions) {