diff --git a/README.md b/README.md index c1c6cfdb..38f90cdc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Setup Helm #### Install a specific version of helm binary on the runner. -Acceptable values are latest or any semantic version string like `1.15.0`. Use this action in workflow to define which version of helm will be used. +Acceptable values are latest or any semantic version string like v2.16.7 Use this action in workflow to define which version of helm will be used. ```yaml - uses: azure/setup-helm@v1 diff --git a/lib/run.js b/lib/run.js index 40dd3fa2..550c95fa 100644 --- a/lib/run.js +++ b/lib/run.js @@ -130,6 +130,9 @@ function run() { if (version.toLocaleLowerCase() === 'latest') { version = yield getStableHelmVersion(); } + else if (!version.toLocaleLowerCase().startsWith('v')) { + version = 'v' + version; + } let cachedPath = yield downloadHelm(version); try { if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) { diff --git a/src/run.ts b/src/run.ts index 46aaf43d..aafcf7ec 100644 --- a/src/run.ts +++ b/src/run.ts @@ -120,6 +120,8 @@ async function run() { let version = core.getInput('version', { 'required': true }); if (version.toLocaleLowerCase() === 'latest') { version = await getStableHelmVersion(); + } else if (!version.toLocaleLowerCase().startsWith('v')) { + version = 'v' + version; } let cachedPath = await downloadHelm(version);