@@ -41738,7 +41738,7 @@ async function isAuthenticated() {
4173841738 * specification is installed.
4173941739 * @returns The path of the installed tool.
4174041740 */
41741- async function installGcloudSDK(version) {
41741+ async function installGcloudSDK(version, skipToolCache ) {
4174241742 // Retrieve the release corresponding to the specified version and OS
4174341743 const osPlat = os.platform();
4174441744 const osArch = os.arch();
@@ -41751,12 +41751,25 @@ async function installGcloudSDK(version) {
4175141751 if (!extPath) {
4175241752 throw new Error(`Failed to download release, url: ${url}`);
4175341753 }
41754- // Install the downloaded release into the github action env
41755- const toolRoot = path.join(extPath, 'google-cloud-sdk');
41756- let toolPath = await toolCache.cacheDir(toolRoot, 'gcloud', resolvedVersion);
41757- toolPath = path.join(toolPath, 'bin');
41758- core.addPath(toolPath);
41759- return toolPath;
41754+ // Either cache the tool or just add it directly to the path.
41755+ if (skipToolCache) {
41756+ // Caching the tool on disk takes a really long time, and it's not clear
41757+ // whether it's even valuable since it's ONLY cached on disk on the runner.
41758+ // For GitHub-managed runners, that is useless since they are ephemeral.
41759+ //
41760+ // See https://github.com/google-github-actions/setup-gcloud/issues/701 for
41761+ // discussion, but it's actually faster to skip the caching and just add the
41762+ // tool directly to the path.
41763+ const toolRoot = path.join(extPath, 'google-cloud-sdk');
41764+ core.addPath(path.join(toolRoot, 'bin'));
41765+ return toolRoot;
41766+ }
41767+ else {
41768+ const toolRoot = path.join(extPath, 'google-cloud-sdk');
41769+ const cachedToolRoot = await toolCache.cacheDir(toolRoot, 'gcloud', resolvedVersion, osArch);
41770+ core.addPath(path.join(cachedToolRoot, 'bin'));
41771+ return cachedToolRoot;
41772+ }
4176041773}
4176141774/**
4176241775 * computeGcloudVersion computes the appropriate gcloud version for the given
@@ -43915,7 +43928,7 @@ module.exports = parseParams
4391543928/***/ ((module) => {
4391643929
4391743930"use strict";
43918- module.exports = /*#__PURE__*/JSON.parse('{"name":"@google-github-actions/setup-cloud-sdk","version":"1.2.0","description":"Utilities to download, install, and interact with the Cloud SDK for GitHub Actions","module":"dist/index.js","main":"dist/index.js","types":"dist/index.d.js","engines":{"node":"20.x","npm":"10.x"},"scripts":{"build":"rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts","lint":"eslint .","format":"eslint --fix","docs":"rm -rf docs/ && typedoc --plugin typedoc-plugin-markdown","test":"node --require ts-node/register --test-reporter spec --test tests/download-util.test.ts tests/format-url.test.ts tests/index.test.ts"},"files":["dist/**/*"],"repository":{"type":"git","url":"git+https://github.com/google-github-actions/setup-cloud-sdk.git"},"keywords":["Cloud SDK","google cloud","gcloud"],"author":"Google LLC","license":"Apache-2.0","dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.1.1","@actions/http-client":"^2.2.3","@actions/tool-cache":"^2.0.2","@google-github-actions/actions-utils":"^0.8.8","semver":"^7.7.2"},"devDependencies":{"@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.31.0","@types/node":"^24.0.14","@types/semver":"^7.7.0","@typescript-eslint/eslint-plugin":"^8.37.0","@vercel/ncc":"^0.38.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","eslint":"^9.31.0","prettier":"^3.6.2","ts-node":"^10.9.2","typedoc-plugin-markdown":"^4.7.0","typedoc":"^0.28.7","typescript-eslint":"^8.37.0","typescript":"^5.8.3"}}');
43931+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@google-github-actions/setup-cloud-sdk","version":"1.2.1","description":"Utilities to download, install, and interact with the Cloud SDK for GitHub Actions","module":"dist/index.js","main":"dist/index.js","types":"dist/index.d.js","engines":{"node":"20.x","npm":"10.x"},"scripts":{"build":"rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts","lint":"eslint .","format":"eslint --fix","docs":"rm -rf docs/ && typedoc --plugin typedoc-plugin-markdown","test":"node --require ts-node/register --test-reporter spec --test tests/download-util.test.ts tests/format-url.test.ts tests/index.test.ts"},"files":["dist/**/*"],"repository":{"type":"git","url":"git+https://github.com/google-github-actions/setup-cloud-sdk.git"},"keywords":["Cloud SDK","google cloud","gcloud"],"author":"Google LLC","license":"Apache-2.0","dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.1.1","@actions/http-client":"^2.2.3","@actions/tool-cache":"^2.0.2","@google-github-actions/actions-utils":"^0.8.8","semver":"^7.7.2"},"devDependencies":{"@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.31.0","@types/node":"^24.0.14","@types/semver":"^7.7.0","@typescript-eslint/eslint-plugin":"^8.37.0","@vercel/ncc":"^0.38.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","eslint":"^9.31.0","prettier":"^3.6.2","ts-node":"^10.9.2","typedoc-plugin-markdown":"^4.7.0","typedoc":"^0.28.7","typescript-eslint":"^8.37.0","typescript":"^5.8.3"}}');
4391943932
4392043933/***/ })
4392143934
0 commit comments