Skip to content

Commit f12ea76

Browse files
authored
better handle version string (v prefix) (#97)
1 parent f714cd2 commit f12ea76

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

.github/workflows/check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
run:
2626
shell: bash
2727
strategy:
28+
max-parallel: 1
2829
matrix:
2930
system:
3031
- ubuntu-latest
@@ -49,6 +50,7 @@ jobs:
4950
run:
5051
shell: bash
5152
strategy:
53+
max-parallel: 1
5254
matrix:
5355
system:
5456
- ubuntu-latest
@@ -67,3 +69,27 @@ jobs:
6769
exit 1
6870
fi
6971
echo OK
72+
test-version-prefix:
73+
defaults:
74+
run:
75+
shell: bash
76+
strategy:
77+
max-parallel: 1
78+
matrix:
79+
system:
80+
- ubuntu-latest
81+
- macos-latest
82+
- windows-latest
83+
runs-on: ${{ matrix.system }}
84+
steps:
85+
- uses: actions/checkout@v3
86+
- name: run action with latest
87+
uses: ./
88+
with:
89+
version: 0.15.1
90+
- name: test CML specific version
91+
run: |
92+
if [ "$(cml --version 2>&1)" != '0.15.1' ]; then
93+
exit 1
94+
fi
95+
echo OK

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ steps:
5353
- uses: actions/checkout@v3
5454
- uses: iterative/setup-cml@v2
5555
with:
56-
version: '0.18.1'
56+
version: 'v0.18.1'
57+
```
58+
59+
Without vega tools
60+
```yaml
61+
steps:
62+
- uses: actions/checkout@v3
63+
- uses: iterative/setup-cml@v2
64+
with:
65+
version: 'v0.20.0'
66+
vega: false
5767
```
5868
5969
## Inputs
@@ -93,3 +103,11 @@ When using the `cml runner launch` command a [PAT is required](https://cml.dev/d
93103
### CML functions
94104

95105
CML provides several helper functions. See [the docs](https://cml.dev/doc).
106+
107+
## Contributing
108+
109+
To get started after cloning the repo, run `npm ci` (clean-install).
110+
Before pushing changes or opening a PR run `npm run format && npm run lint` to
111+
ensure that the code is formatted and linted.
112+
113+
run `npm run build` to compile the action.

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14938,7 +14938,7 @@ function getCmlDownloadUrl(version, assetName) {
1493814938
const response = yield octokit.repos.getReleaseByTag({
1493914939
owner: 'iterative',
1494014940
repo: 'cml',
14941-
tag: version
14941+
tag: version.startsWith('v') ? version : `v${version}`
1494214942
});
1494314943
release = response.data;
1494414944
}

src/setup-cml.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function getCmlDownloadUrl(
7070
const response = await octokit.repos.getReleaseByTag({
7171
owner: 'iterative',
7272
repo: 'cml',
73-
tag: version
73+
tag: version.startsWith('v') ? version : `v${version}`
7474
});
7575
release = response.data;
7676
}

0 commit comments

Comments
 (0)