File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,9 +76,6 @@ async function installGitHubReleaseBinary(
7676 ] . join ( "-" ) ;
7777 const restoreCache = await cache . restoreCache ( cachePaths , cacheKey ) ;
7878
79- // DEBUG:
80- core . warning ( `Restore cache: ${ restoreCache } ` ) ;
81-
8279 // If unable to restore from the cache, download the binary from GitHub
8380 if ( restoreCache === undefined ) {
8481 const releaseAsset = await fetchReleaseAssetMetadataFromTag (
@@ -96,7 +93,24 @@ async function installGitHubReleaseBinary(
9693 { accept : "application/octet-stream" }
9794 ) ;
9895
99- await cache . saveCache ( cachePaths , cacheKey ) ;
96+ // Tolerate cache errors.
97+ // Possibly related to https://github.com/actions/toolkit/issues/658
98+ try {
99+ await cache . saveCache ( cachePaths , cacheKey ) ;
100+ } catch ( error ) {
101+ // NOTE: this is an unlawful cast
102+ const typedError = error as Error ;
103+ switch ( typedError . name ) {
104+ case cache . ValidationError . name :
105+ throw error ;
106+ case cache . ReserveCacheError . name :
107+ core . info ( typedError . message ) ;
108+ break ;
109+ default :
110+ core . warning ( typedError . message ) ;
111+ break ;
112+ }
113+ }
100114 }
101115
102116 // Permissions are an attribute of the filesystem, not the file.
You can’t perform that action at this time.
0 commit comments