diff --git a/src/index.ts b/src/index.ts index 6652457..cd82d83 100644 --- a/src/index.ts +++ b/src/index.ts @@ -81,6 +81,13 @@ export async function main() { // download or pull from cache const toolPath = await downloadTool(config); + if (config.binPath != "") { + config.binPath = template(config.binPath, { + ...config, + ...templateArgs, + }); + } + core.debug("cached path: " + toolPath); core.addPath(path.join(toolPath, config.binPath)); core.info(`Successfully installed version ${config.version}`); diff --git a/src/presets/index.ts b/src/presets/index.ts index b30d15e..37816a2 100644 --- a/src/presets/index.ts +++ b/src/presets/index.ts @@ -12,6 +12,13 @@ const presets: Record> = { "https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v{{version}}/cloud-sql-proxy.{{os}}.{{arch}}", downloadName: "cloud-sql-proxy", }, + "github-cli": { + repo: "cli/cli", + version: "2.62.0", + downloadUrl: + "/releases/download/v{{version}}/gh_{{version}}_{{os}}_{{arch}}.{{archive}}", + binPath: "/gh_{{version}}_{{os}}_{{arch}}/bin", + }, }; export default presets;