Skip to content

Commit

Permalink
Support unstable releases (#15)
Browse files Browse the repository at this point in the history
Supports unstable releases per
rwx-research/captain#32
  • Loading branch information
kylekthompson authored Apr 12, 2023
1 parent faf31d2 commit cf0d9ca
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/continuous_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
version: 1.0.57
- run: captain --version | grep '^v1\.0\.57$'

test_unstable_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
version: unstable
- run: captain --version | grep '^unstable-'

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6588,7 +6588,8 @@ function run() {
silent: true
});
const cliVersion = stdout.replace('\n', '');
if (cliVersion !== version && version !== 'v1') {
const aliasVersions = ['v1', 'unstable'];
if (cliVersion !== version && !aliasVersions.includes(version)) {
throw `Unexpected version of Captain installed. Expected ${version} but installed ${cliVersion}`;
}
core.info(`captain ${cliVersion} is installed`);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.7",
"version": "1.2.0",
"description": "This action installs the captain CLI in Github Actions",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ async function run() {
silent: true
})
const cliVersion = stdout.replace('\n', '')
if (cliVersion !== version && version !== 'v1') {
const aliasVersions = ['v1', 'unstable']
if (cliVersion !== version && !aliasVersions.includes(version)) {
throw `Unexpected version of Captain installed. Expected ${version} but installed ${cliVersion}`
}
core.info(`captain ${cliVersion} is installed`)
Expand Down

0 comments on commit cf0d9ca

Please sign in to comment.