Added ability to disable automatic action caching. (#212)
This commit is contained in:
parent
f0a88fe39d
commit
0e7059cb40
4 changed files with 28 additions and 2 deletions
|
@ -12,6 +12,10 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: "true"
|
default: "true"
|
||||||
description: 'if false, will not run `rtx install`'
|
description: 'if false, will not run `rtx install`'
|
||||||
|
cache:
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
|
description: 'if false, action will not automatically cache'
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate if a cache was hit.'
|
description: 'A boolean value to indicate if a cache was hit.'
|
||||||
|
|
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
|
@ -82932,7 +82932,14 @@ const path = __importStar(__nccwpck_require__(1017));
|
||||||
const utils_1 = __nccwpck_require__(1314);
|
const utils_1 = __nccwpck_require__(1314);
|
||||||
async function run() {
|
async function run() {
|
||||||
await setToolVersions();
|
await setToolVersions();
|
||||||
await restoreRTXCache();
|
if (core.getBooleanInput('cache')) {
|
||||||
|
await restoreRTXCache();
|
||||||
|
core.saveState('CACHE', false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.saveState('CACHE', true);
|
||||||
|
core.setOutput('cache-hit', false);
|
||||||
|
}
|
||||||
await setupRTX();
|
await setupRTX();
|
||||||
await setEnvVars();
|
await setEnvVars();
|
||||||
await exec.exec('rtx', ['--version']);
|
await exec.exec('rtx', ['--version']);
|
||||||
|
|
|
@ -12,6 +12,13 @@ export async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function cacheRTXTools(): Promise<void> {
|
async function cacheRTXTools(): Promise<void> {
|
||||||
|
const skipCache = core.getState('CACHE')
|
||||||
|
|
||||||
|
if (skipCache) {
|
||||||
|
core.info('Skipping saving cache')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const state = core.getState('CACHE_KEY')
|
const state = core.getState('CACHE_KEY')
|
||||||
const primaryKey = core.getState('PRIMARY_KEY')
|
const primaryKey = core.getState('PRIMARY_KEY')
|
||||||
const cachePath = rtxDir()
|
const cachePath = rtxDir()
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -9,7 +9,15 @@ import { rtxDir } from './utils'
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
await setToolVersions()
|
await setToolVersions()
|
||||||
await restoreRTXCache()
|
|
||||||
|
if (core.getBooleanInput('cache')) {
|
||||||
|
await restoreRTXCache()
|
||||||
|
core.saveState('CACHE', false)
|
||||||
|
} else {
|
||||||
|
core.saveState('CACHE', true)
|
||||||
|
core.setOutput('cache-hit', false)
|
||||||
|
}
|
||||||
|
|
||||||
await setupRTX()
|
await setupRTX()
|
||||||
await setEnvVars()
|
await setEnvVars()
|
||||||
await exec.exec('rtx', ['--version'])
|
await exec.exec('rtx', ['--version'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue