Changed the documentation to specify v before 'version' and code changes 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
This commit is contained in:
Родитель
b1c4524a5f
Коммит
91b7d21636
|
@ -1,7 +1,7 @@
|
||||||
# Setup Helm
|
# Setup Helm
|
||||||
#### Install a specific version of helm binary on the runner.
|
#### 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
|
```yaml
|
||||||
- uses: azure/setup-helm@v1
|
- uses: azure/setup-helm@v1
|
||||||
|
|
|
@ -130,6 +130,9 @@ function run() {
|
||||||
if (version.toLocaleLowerCase() === 'latest') {
|
if (version.toLocaleLowerCase() === 'latest') {
|
||||||
version = yield getStableHelmVersion();
|
version = yield getStableHelmVersion();
|
||||||
}
|
}
|
||||||
|
else if (!version.toLocaleLowerCase().startsWith('v')) {
|
||||||
|
version = 'v' + version;
|
||||||
|
}
|
||||||
let cachedPath = yield downloadHelm(version);
|
let cachedPath = yield downloadHelm(version);
|
||||||
try {
|
try {
|
||||||
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
|
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
|
||||||
|
|
|
@ -120,6 +120,8 @@ async function run() {
|
||||||
let version = core.getInput('version', { 'required': true });
|
let version = core.getInput('version', { 'required': true });
|
||||||
if (version.toLocaleLowerCase() === 'latest') {
|
if (version.toLocaleLowerCase() === 'latest') {
|
||||||
version = await getStableHelmVersion();
|
version = await getStableHelmVersion();
|
||||||
|
} else if (!version.toLocaleLowerCase().startsWith('v')) {
|
||||||
|
version = 'v' + version;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cachedPath = await downloadHelm(version);
|
let cachedPath = await downloadHelm(version);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче