Skip to content

Commit 159a07c

Browse files
Release: v1.2.0 (#339)
## What's Changed * Use new Pull Request action by @sethvargo in #307 * Revert to pin release workflows by @sethvargo in #309 * Update gcloud versions by @google-github-actions-bot in #310 * Update gcloud versions by @google-github-actions-bot in #311 * Update gcloud versions by @google-github-actions-bot in #312 * Update gcloud versions by @google-github-actions-bot in #313 * Update gcloud versions by @google-github-actions-bot in #314 * Update gcloud versions by @google-github-actions-bot in #315 * Bump golang.org/x/net from 0.33.0 to 0.36.0 in the go_modules group across 1 directory by @dependabot[bot] in #316 * Update gcloud versions by @google-github-actions-bot in #317 * Update gcloud versions by @google-github-actions-bot in #318 * Update gcloud versions by @google-github-actions-bot in #319 * Update gcloud versions by @google-github-actions-bot in #320 * Bump golang.org/x/net from 0.36.0 to 0.38.0 in the go_modules group across 1 directory by @dependabot[bot] in #321 * Update gcloud versions by @google-github-actions-bot in #322 * Update gcloud versions by @google-github-actions-bot in #323 * Update gcloud versions by @google-github-actions-bot in #324 * Update gcloud versions by @google-github-actions-bot in #325 * Update gcloud versions by @google-github-actions-bot in #326 * Update gcloud versions by @google-github-actions-bot in #327 * Update gcloud versions by @google-github-actions-bot in #328 * Update gcloud versions by @google-github-actions-bot in #329 * Update gcloud versions by @google-github-actions-bot in #330 * Update gcloud versions by @google-github-actions-bot in #331 * Update gcloud versions by @google-github-actions-bot in #332 * Update gcloud versions by @google-github-actions-bot in #333 * Update gcloud versions by @google-github-actions-bot in #334 * Update gcloud versions by @google-github-actions-bot in #335 * Update linters by @sethvargo in #336 * Update deps by @sethvargo in #337 * Use retries for bestVersion by @sethvargo in #338 **Full Changelog**: v1.1.9...v1.2.0
1 parent 5bc3593 commit 159a07c

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

dist/index.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41835,20 +41835,26 @@ async function getLatestGcloudSDKVersion() {
4183541835
async function bestVersion(spec) {
4183641836
let versions;
4183741837
try {
41838-
const http = new http_client_1.HttpClient(exports.userAgentString, undefined, { allowRetries: true, maxRetries: 3 });
41839-
const res = await http.get(versionsURL);
41840-
const body = await res.readBody();
41841-
const statusCode = res.message.statusCode || 500;
41842-
if (statusCode >= 400) {
41843-
throw new Error(`(${statusCode}) ${body}`);
41844-
}
41845-
versions = JSON.parse(body);
41838+
return await (0, actions_utils_1.withRetries)(async () => {
41839+
const http = new http_client_1.HttpClient(exports.userAgentString);
41840+
const res = await http.get(versionsURL);
41841+
const body = await res.readBody();
41842+
const statusCode = res.message.statusCode || 500;
41843+
if (statusCode >= 400) {
41844+
throw new Error(`(${statusCode}) ${body}`);
41845+
}
41846+
versions = JSON.parse(body);
41847+
return computeBestVersion(spec, versions);
41848+
}, {
41849+
retries: 3,
41850+
backoff: 100, // 100 milliseconds
41851+
backoffLimit: 1_000, // 1 second
41852+
})();
4184641853
}
4184741854
catch (err) {
4184841855
const msg = (0, actions_utils_1.errorMessage)(err);
4184941856
throw new Error(`failed to retrieve versions from ${versionsURL}: ${msg}`);
4185041857
}
41851-
return computeBestVersion(spec, versions);
4185241858
}
4185341859
/**
4185441860
* computeBestVersion computes the latest available version that still satisfies
@@ -43909,7 +43915,7 @@ module.exports = parseParams
4390943915
/***/ ((module) => {
4391043916

4391143917
"use strict";
43912-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@google-github-actions/setup-cloud-sdk","version":"1.1.9","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"}}');
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"}}');
4391343919

4391443920
/***/ })
4391543921

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index/functions/computeBestVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **computeBestVersion**(`spec`, `versions`): `string`
1010
11-
Defined in: [index.ts:300](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L300)
11+
Defined in: [index.ts:309](https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L309)
1212

1313
computeBestVersion computes the latest available version that still satisfies
1414
the spec. This is a helper function and is only exported for testing.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@google-github-actions/setup-cloud-sdk",
3-
"version": "1.1.9",
3+
"version": "1.2.0",
44
"description": "Utilities to download, install, and interact with the Cloud SDK for GitHub Actions",
55
"module": "dist/index.js",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)