Skip to content

Commit

Permalink
better handle version string (v prefix) (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacbd committed Oct 5, 2023
1 parent f714cd2 commit f12ea76
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run:
shell: bash
strategy:
max-parallel: 1
matrix:
system:
- ubuntu-latest
Expand All @@ -49,6 +50,7 @@ jobs:
run:
shell: bash
strategy:
max-parallel: 1
matrix:
system:
- ubuntu-latest
Expand All @@ -67,3 +69,27 @@ jobs:
exit 1
fi
echo OK
test-version-prefix:
defaults:
run:
shell: bash
strategy:
max-parallel: 1
matrix:
system:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@v3
- name: run action with latest
uses: ./
with:
version: 0.15.1
- name: test CML specific version
run: |
if [ "$(cml --version 2>&1)" != '0.15.1' ]; then
exit 1
fi
echo OK
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v2
with:
version: '0.18.1'
version: 'v0.18.1'
```

Without vega tools
```yaml
steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v2
with:
version: 'v0.20.0'
vega: false
```

## Inputs
Expand Down Expand Up @@ -93,3 +103,11 @@ When using the `cml runner launch` command a [PAT is required](https://cml.dev/d
### CML functions

CML provides several helper functions. See [the docs](https://cml.dev/doc).

## Contributing

To get started after cloning the repo, run `npm ci` (clean-install).
Before pushing changes or opening a PR run `npm run format && npm run lint` to
ensure that the code is formatted and linted.

run `npm run build` to compile the action.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14938,7 +14938,7 @@ function getCmlDownloadUrl(version, assetName) {
const response = yield octokit.repos.getReleaseByTag({
owner: 'iterative',
repo: 'cml',
tag: version
tag: version.startsWith('v') ? version : `v${version}`
});
release = response.data;
}
Expand Down
2 changes: 1 addition & 1 deletion src/setup-cml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function getCmlDownloadUrl(
const response = await octokit.repos.getReleaseByTag({
owner: 'iterative',
repo: 'cml',
tag: version
tag: version.startsWith('v') ? version : `v${version}`
});
release = response.data;
}
Expand Down

0 comments on commit f12ea76

Please sign in to comment.