mirror of
https://github.com/Azure/setup-helm.git
synced 2025-07-25 07:01:09 +00:00
Version fix (#66)
* Added version validation check * Added check for latest * Changed Helm 3.5.0 test to also test lack of v in version * Pushing integration tests * Removed push integration test * Added more context to integration test * Addressing comment
This commit is contained in:
@ -17,6 +17,9 @@ const helmAllReleasesUrl = "https://api.github.com/repos/helm/helm/releases";
|
||||
export async function run() {
|
||||
let version = core.getInput("version", { required: true });
|
||||
|
||||
if(version !== "latest" && version[0] !== "v"){
|
||||
version = getValidVersion(version);
|
||||
}
|
||||
if (version.toLocaleLowerCase() === "latest") {
|
||||
version = await getLatestHelmVersion();
|
||||
}
|
||||
@ -38,6 +41,11 @@ export async function run() {
|
||||
core.setOutput("helm-path", cachedPath);
|
||||
}
|
||||
|
||||
//Returns version with proper v before it
|
||||
export function getValidVersion(version: string): string {
|
||||
return "v" + version;
|
||||
}
|
||||
|
||||
// Downloads the helm releases JSON and parses all the recent versions of helm from it.
|
||||
// Defaults to sending stable helm version if none are valid or if it fails
|
||||
|
||||
|
Reference in New Issue
Block a user