Commit 735686b 1 parent 95167f6 commit 735686b Copy full SHA for 735686b
File tree 3 files changed +4
-1
lines changed
3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import * as cache from "@actions/cache";
4
4
import { getCacheDirectory , State } from "./cache-utils" ;
5
5
6
6
async function saveCache ( ) {
7
- const enableCache = core . getBooleanInput ( "cache" ) ;
7
+ const enableCache = JSON . parse ( core . getState ( State . CacheEnabledKey ) ) ;
8
8
9
9
if ( ! enableCache ) {
10
10
core . info ( `Caching disabled, not saving cache.` ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import fs from "fs/promises";
9
9
export const State = {
10
10
CachePrimaryKey : "primary_key" ,
11
11
CacheMatchedKey : "matched_key" ,
12
+ CacheEnabledKey : "cache_enabled" ,
12
13
} ;
13
14
14
15
export async function getCacheDirectory ( ) {
Original file line number Diff line number Diff line change 9
9
import { downloadScarb } from "./download" ;
10
10
import { getOsTriplet } from "./platform" ;
11
11
import { restoreCache } from "./cache-restore" ;
12
+ import { State } from "./cache-utils" ;
12
13
13
14
export default async function main ( ) {
14
15
try {
@@ -49,6 +50,7 @@ export default async function main() {
49
50
50
51
core . setOutput ( "scarb-version" , await getFullVersionFromScarb ( ) ) ;
51
52
53
+ core . saveState ( State . CacheEnabledKey , enableCache ) ;
52
54
if ( enableCache ) {
53
55
await restoreCache ( scarbLockPathInput ) . catch ( ( e ) => {
54
56
core . error (
You can’t perform that action at this time.
0 commit comments