Skip to content

Commit 8dd348c

Browse files
committed
Fixed helm latest version download error
1 parent 53049fa commit 8dd348c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tasks/Common/kubernetes-common/helmutility.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ export async function getStableHelmVersion(): Promise<string> {
6969
try {
7070
const downloadPath = await toolLib.downloadTool('https://api.github.com/repos/helm/helm/releases/latest');
7171
const response = JSON.parse(fs.readFileSync(downloadPath, 'utf8').toString().trim());
72-
return response.body.tag_name;
72+
if (!response.tag_name)
73+
{
74+
return stableHelmVersion;
75+
}
76+
77+
return response.tag_name;
7378
} catch (error) {
7479
tl.warning(tl.loc('HelmLatestNotKnown', helmLatestReleaseUrl, error, stableHelmVersion));
7580
}

0 commit comments

Comments
 (0)