diff --git a/action.yml b/action.yml index 2a57a4e..f3b49cc 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,7 @@ inputs: default: true cache-dependency-path: description: 'Used to specify the path to a dependency file - go.sum' - buildTarget: + buildTargetArch: description: 'Optional build target architecture (for example arm64 or amd64) used to scope the cache key.' architecture: description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.' diff --git a/src/cache-restore.ts b/src/cache-restore.ts index b7c6647..d5a6e72 100644 --- a/src/cache-restore.ts +++ b/src/cache-restore.ts @@ -12,7 +12,7 @@ export const restoreCache = async ( versionSpec: string, packageManager: string, cacheDependencyPath?: string, - buildTarget?: string + buildTargetArch?: string ) => { const packageManagerInfo = await getPackageManagerInfo(packageManager); const platform = process.env.RUNNER_OS; @@ -33,7 +33,7 @@ export const restoreCache = async ( const linuxVersion = process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : ''; - const sanitizedBuildTarget = buildTarget?.trim(); + const sanitizedBuildTarget = buildTargetArch?.trim(); const targetSegment = sanitizedBuildTarget ? `${sanitizedBuildTarget}-` : ''; const primaryKey = `setup-go-${platform}-${arch}-${targetSegment}${linuxVersion}go-${versionSpec}-${fileHash}`; core.debug(`primary key is ${primaryKey}`); diff --git a/src/main.ts b/src/main.ts index 817d802..4d4b478 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,7 +20,7 @@ export async function run() { setGoToolchain(); const cache = core.getBooleanInput('cache'); - const buildTarget = core.getInput('buildTarget'); + const buildTargetArch = core.getInput('buildTargetArch'); core.info(`Setup go version spec ${versionSpec}`); let arch = core.getInput('architecture') as Architecture; @@ -75,7 +75,7 @@ export async function run() { parseGoVersion(goVersion), packageManager, cacheDependencyPath, - buildTarget + buildTargetArch ); } catch (error) { core.warning(`Restore cache failed: ${(error as Error).message}`);