@@ -41,6 +41,7 @@ async function installGitHubReleaseBinary(
4141 octokit : Octokit ,
4242 targetBinary : TargetBinary ,
4343 storageDirectory : string ,
44+ enableCache : boolean ,
4445 token : string
4546) : Promise < void > {
4647 const targetTriple = getTargetTriple ( arch ( ) , platform ( ) ) ;
@@ -74,7 +75,10 @@ async function installGitHubReleaseBinary(
7475 releaseTag ,
7576 targetTriple ,
7677 ] . join ( "-" ) ;
77- const restoreCache = await cache . restoreCache ( cachePaths , cacheKey ) ;
78+
79+ const restoreCache = enableCache
80+ ? await cache . restoreCache ( cachePaths , cacheKey )
81+ : undefined ;
7882
7983 // If unable to restore from the cache, download the binary from GitHub
8084 if ( restoreCache === undefined ) {
@@ -93,7 +97,9 @@ async function installGitHubReleaseBinary(
9397 { accept : "application/octet-stream" }
9498 ) ;
9599
96- await cache . saveCache ( cachePaths , cacheKey ) ;
100+ if ( enableCache ) {
101+ await cache . saveCache ( cachePaths , cacheKey ) ;
102+ }
97103 }
98104
99105 // Permissions are an attribute of the filesystem, not the file.
@@ -120,6 +126,7 @@ async function main(): Promise<void> {
120126 const token = unwrap ( maybeToken ) ;
121127 const targetBinary = unwrap ( maybeTargetBinary ) ;
122128 const homeDirectory = unwrap ( maybeHomeDirectory ) ;
129+ const enableCache = core . getInput ( "cache" ) === "true" ;
123130
124131 const storageDirectory = path . join (
125132 homeDirectory ,
@@ -132,6 +139,7 @@ async function main(): Promise<void> {
132139 octokit ,
133140 targetBinary ,
134141 storageDirectory ,
142+ enableCache ,
135143 token
136144 ) ;
137145}
0 commit comments