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
src/run.ts
10
src/run.ts
|
|
@ -85,12 +85,12 @@ export async function getLatestHelmVersion(): Promise<string> {
|
|||
let helmJSONPath:string = await 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));
|
||||
return stableHelmVersion;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue