Skip to content

Commit

Permalink
Add API to enable the experimental features (#220)
Browse files Browse the repository at this point in the history
* Add option to enable experimental features

* Add .rtx.toml to install the tools necessary to work on this repository
  • Loading branch information
pepicrft authored Dec 24, 2023
1 parent 867a9c3 commit 10161a1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .rtx.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = '20.10.0'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function setEnvVars(): Promise<void> {
}
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`)
Expand Down Expand Up @@ -87,6 +88,11 @@ async function setupRTX(version: string | undefined): Promise<void> {
core.addPath(rtxBinDir)
}

function getExperimental(): boolean {
const experimentalString = core.getInput('experimental')
return experimentalString === 'true' ? true : false
}

async function setToolVersions(): Promise<void> {
const toolVersions = core.getInput('tool_versions')
if (toolVersions) {
Expand Down

0 comments on commit 10161a1

Please sign in to comment.