From 1764424b687cb02d08bd5e23f4b79f3dc0782ad4 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Thu, 30 Oct 2025 12:17:30 +0100 Subject: [PATCH] cosign(install): skipState opt to directly upload to GHA cache Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/cosign/install.ts | 10 +++++----- src/undock/install.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cosign/install.ts b/src/cosign/install.ts index 3e3d2b8..0673b2a 100644 --- a/src/cosign/install.ts +++ b/src/cosign/install.ts @@ -48,7 +48,7 @@ export class Install { this.buildx = opts?.buildx || new Buildx(); } - public async download(v: string, ghaNoCache?: boolean): Promise { + public async download(v: string, ghaNoCache?: boolean, skipState?: boolean): Promise { const version: DownloadVersion = await Install.getDownloadVersion(v); core.debug(`Install.download version: ${version.version}`); @@ -83,12 +83,12 @@ export class Install { const htcDownloadPath = await tc.downloadTool(downloadURL, undefined, this.githubToken); core.debug(`Install.download htcDownloadPath: ${htcDownloadPath}`); - const cacheSavePath = await installCache.save(htcDownloadPath); + const cacheSavePath = await installCache.save(htcDownloadPath, skipState); core.info(`Cached to ${cacheSavePath}`); return cacheSavePath; } - public async build(gitContext: string, ghaNoCache?: boolean): Promise { + public async build(gitContext: string, ghaNoCache?: boolean, skipState?: boolean): Promise { const vspec = await this.vspec(gitContext); core.debug(`Install.build vspec: ${vspec}`); @@ -119,7 +119,7 @@ export class Install { return `${outputDir}/cosign`; }); - const cacheSavePath = await installCache.save(buildBinPath); + const cacheSavePath = await installCache.save(buildBinPath, skipState); core.info(`Cached to ${cacheSavePath}`); return cacheSavePath; } @@ -139,7 +139,7 @@ export class Install { fs.chmodSync(cosignPath, '0755'); core.addPath(binDir); - core.info('Added Unodck to PATH'); + core.info('Added Cosign to PATH'); core.info(`Binary path: ${cosignPath}`); return cosignPath; diff --git a/src/undock/install.ts b/src/undock/install.ts index 1bc766b..2b19003 100644 --- a/src/undock/install.ts +++ b/src/undock/install.ts @@ -71,7 +71,7 @@ export class Install { const cacheFoundPath = await installCache.find(); if (cacheFoundPath) { - core.info(`Unodck binary found in ${cacheFoundPath}`); + core.info(`Undock binary found in ${cacheFoundPath}`); return cacheFoundPath; } @@ -112,7 +112,7 @@ export class Install { fs.chmodSync(undockPath, '0755'); core.addPath(binDir); - core.info('Added Unodck to PATH'); + core.info('Added Undock to PATH'); core.info(`Binary path: ${undockPath}`); return undockPath;