mirror of
https://github.com/Azure/setup-helm.git
synced 2026-04-14 10:34:47 +00:00
fixed method to access helm releses JSON
This commit is contained in:
parent
45f20ed080
commit
f89e61b2b4
2 changed files with 10 additions and 10 deletions
10
lib/run.js
10
lib/run.js
|
|
@ -90,12 +90,12 @@ function getLatestHelmVersion() {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let helmJSONPath = yield toolCache.downloadTool(helmAllReleasesUrl);
|
||||
try {
|
||||
const helmJSONArray = JSON.parse(fs.readFileSync(helmJSONPath, 'utf-8'));
|
||||
helmJSONArray.forEach(ver => {
|
||||
if (isValidVersion(ver["tag_name"])) {
|
||||
return ver;
|
||||
const helmJSON = JSON.parse(fs.readFileSync(helmJSONPath, 'utf-8'));
|
||||
for (let i in helmJSON) {
|
||||
if (isValidVersion(helmJSON[i].tag_name)) {
|
||||
return helmJSON[i].tag_name;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
core.warning(util.format("Error while fetching the latest Helm release. Error: %s. Using default Helm version %s", err.toString(), stableHelmVersion));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue