Commit 95167f6 1 parent 5a40f12 commit 95167f6 Copy full SHA for 95167f6
File tree 3 files changed +5
-11
lines changed
3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 1
1
import * as core from "@actions/core" ;
2
2
import * as cache from "@actions/cache" ;
3
3
4
- import { getCacheDirectory , isCacheEnabled , State } from "./cache-utils" ;
4
+ import { getCacheDirectory , State } from "./cache-utils" ;
5
5
6
6
async function saveCache ( ) {
7
- const cacheInput = core . getInput ( "cache" ) ;
7
+ const enableCache = core . getBooleanInput ( "cache" ) ;
8
8
9
- if ( ! isCacheEnabled ( cacheInput ) ) {
9
+ if ( ! enableCache ) {
10
10
core . info ( `Caching disabled, not saving cache.` ) ;
11
11
return ;
12
12
}
Original file line number Diff line number Diff line change @@ -11,11 +11,6 @@ export const State = {
11
11
CacheMatchedKey : "matched_key" ,
12
12
} ;
13
13
14
- export function isCacheEnabled ( cacheInput ) {
15
- cacheInput = cacheInput || "true" ;
16
- return cacheInput === "true" ;
17
- }
18
-
19
14
export async function getCacheDirectory ( ) {
20
15
// NOTE: The `cache path` command was introduced in Scarb 0.7.0. We do not want to break compatibility with older
21
16
// versions yet, so we fall back to a well-known cache path if this command is not available.
Original file line number Diff line number Diff line change @@ -9,14 +9,13 @@ import {
9
9
import { downloadScarb } from "./download" ;
10
10
import { getOsTriplet } from "./platform" ;
11
11
import { restoreCache } from "./cache-restore" ;
12
- import { isCacheEnabled } from "./cache-utils" ;
13
12
14
13
export default async function main ( ) {
15
14
try {
16
15
const scarbVersionInput = core . getInput ( "scarb-version" ) ;
17
16
const toolVersionsPathInput = core . getInput ( "tool-versions" ) ;
18
17
const scarbLockPathInput = core . getInput ( "scarb-lock" ) ;
19
- const cacheInput = core . getInput ( "cache" ) ;
18
+ const enableCache = core . getBooleanInput ( "cache" ) ;
20
19
21
20
const { repo : scarbRepo , version : scarbVersion } = await determineVersion (
22
21
scarbVersionInput ,
@@ -50,7 +49,7 @@ export default async function main() {
50
49
51
50
core . setOutput ( "scarb-version" , await getFullVersionFromScarb ( ) ) ;
52
51
53
- if ( isCacheEnabled ( cacheInput ) ) {
52
+ if ( enableCache ) {
54
53
await restoreCache ( scarbLockPathInput ) . catch ( ( e ) => {
55
54
core . error (
56
55
`There was an error when restoring cache: ${
You can’t perform that action at this time.
0 commit comments