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
|
||||
default: "true"
|
||||
description: 'if false, will not run `rtx install`'
|
||||
cache:
|
||||
required: false
|
||||
default: "true"
|
||||
description: 'if false, action will not automatically cache'
|
||||
outputs:
|
||||
cache-hit:
|
||||
description: 'A boolean value to indicate if a cache was hit.'
|
||||
|
|
7
dist/index.js
generated
vendored
7
dist/index.js
generated
vendored
|
@ -82932,7 +82932,14 @@ const path = __importStar(__nccwpck_require__(1017));
|
|||
const utils_1 = __nccwpck_require__(1314);
|
||||
async function run() {
|
||||
await setToolVersions();
|
||||
if (core.getBooleanInput('cache')) {
|
||||
await restoreRTXCache();
|
||||
core.saveState('CACHE', false);
|
||||
}
|
||||
else {
|
||||
core.saveState('CACHE', true);
|
||||
core.setOutput('cache-hit', false);
|
||||
}
|
||||
await setupRTX();
|
||||
await setEnvVars();
|
||||
await exec.exec('rtx', ['--version']);
|
||||
|
|
|
@ -12,6 +12,13 @@ export async function run(): 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 primaryKey = core.getState('PRIMARY_KEY')
|
||||
const cachePath = rtxDir()
|
||||
|
|
|
@ -9,7 +9,15 @@ import { rtxDir } from './utils'
|
|||
|
||||
async function run(): Promise<void> {
|
||||
await setToolVersions()
|
||||
|
||||
if (core.getBooleanInput('cache')) {
|
||||
await restoreRTXCache()
|
||||
core.saveState('CACHE', false)
|
||||
} else {
|
||||
core.saveState('CACHE', true)
|
||||
core.setOutput('cache-hit', false)
|
||||
}
|
||||
|
||||
await setupRTX()
|
||||
await setEnvVars()
|
||||
await exec.exec('rtx', ['--version'])
|
||||
|
|
Loading…
Add table
Reference in a new issue