Skip to content

Commit

Permalink
Changed the documentation to specify v before 'version' and code chan…
Browse files Browse the repository at this point in the history
…ges to append 'v' if it not provided in version (#11) (#15)

* Chnaged the documentation to sepcify v before 'version'

* append v to version incase it does not already include

* review comments fix
  • Loading branch information
rgsubh committed May 14, 2020
1 parent b1c4524 commit 91b7d21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 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
Expand Down
3 changes: 3 additions & 0 deletions lib/run.js
Expand Up @@ -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))) {
Expand Down
2 changes: 2 additions & 0 deletions src/run.ts
Expand Up @@ -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);
Expand Down

0 comments on commit 91b7d21

Please sign in to comment.