Skip to content

Commit

Permalink
Make the v prefix on version numbers optional (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-manges authored Jan 25, 2023
1 parent 2d90234 commit 7998e28
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/continuous_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
version: v0.8.0
- run: captain --version | grep '^v0\.8\.0$'

test_specific_version_without_v_prefix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
version: 1.0.57
- run: captain --version | grep '^v1\.0\.57$'

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6579,6 +6579,9 @@ function run() {
}
version = versions.get(version);
}
if (version.match(/^[0-9]+/)) {
version = `v${version}`;
}
let os = process.platform;
if (os === 'win32') {
os = 'windows';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-captain",
"version": "1.1.3",
"version": "1.1.4",
"description": "This action installs the captain CLI in Github Actions",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ async function run() {

version = versions.get(version) as string
}
if (version.match(/^[0-9]+/)) {
version = `v${version}`
}

let os = process.platform as string
if (os === 'win32') {
Expand Down

0 comments on commit 7998e28

Please sign in to comment.