File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1+ const fs = require ( 'fs' ) . promises ;
12const core = require ( '@actions/core' ) ;
23const github = require ( '@actions/github' ) ;
34const cache = require ( '@actions/cache' ) ;
@@ -6,9 +7,20 @@ const common = require('./common');
67async function main ( ) {
78 try {
89 if ( core . getBooleanInput ( 'use-cache' ) ) {
9- const prefix = await common . getCachePrefix ( ) ;
10- const name = prefix + github . context . runId ;
11- await cache . saveCache ( [ await common . getZigCachePath ( ) ] , name ) ;
10+ const cache_path = await common . getZigCachePath ( ) ;
11+
12+ let accessible = true ;
13+ try {
14+ await fs . access ( cache_path , fs . constants . R_OK ) ;
15+ } catch {
16+ accessible = false ;
17+ }
18+
19+ if ( accessible ) {
20+ const prefix = await common . getCachePrefix ( ) ;
21+ const name = prefix + github . context . runId ;
22+ await cache . saveCache ( [ cache_path ] , name ) ;
23+ }
1224 }
1325 } catch ( err ) {
1426 core . setFailed ( err . message ) ;
You can’t perform that action at this time.
0 commit comments