From cf0d9ca8d8009411cd564d04dfc860a533fab6ab Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Wed, 12 Apr 2023 11:30:41 -0400 Subject: [PATCH] Support unstable releases (#15) Supports unstable releases per https://github.com/rwx-research/captain/pull/32 --- .github/workflows/continuous_integration.yaml | 9 +++++++++ dist/index.js | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- src/index.ts | 3 ++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml index 0067d8a..64e3413 100644 --- a/.github/workflows/continuous_integration.yaml +++ b/.github/workflows/continuous_integration.yaml @@ -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 diff --git a/dist/index.js b/dist/index.js index 7b1b903..d679fbd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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`); diff --git a/package-lock.json b/package-lock.json index fd1a82f..ef78880 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "setup-captain", - "version": "1.1.7", + "version": "1.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "setup-captain", - "version": "1.1.7", + "version": "1.2.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/package.json b/package.json index d28479e..71ab2e0 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.ts b/src/index.ts index 114ae77..1ffca15 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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`)