diff --git a/.github/workflows/ui-release-trigger.yml b/.github/workflows/ui-release-trigger.yml index 62c2d3616..10683ba54 100644 --- a/.github/workflows/ui-release-trigger.yml +++ b/.github/workflows/ui-release-trigger.yml @@ -9,14 +9,11 @@ jobs: trigger-circleci-release: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Trigger Release job - env: - TAG: ${{ github.event.release.tag_name }} - TEST_REF: ${{ github.ref }} run: | - echo "($TAG), ($TEST_REF)" + echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}" + curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \ - -d '{ "branch": "main", "parameters": {"TAG": "'${TAG}'" }}' \ + -d '{ "branch": "main", "parameters": {"TAG": "'${GITHUB_REF#refs/tags/}'" }}' \ https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline diff --git a/ui/desktop/electron-app/src/boundary-cli.js b/ui/desktop/electron-app/src/boundary-cli.js index 2227687ed..e42255ea4 100644 --- a/ui/desktop/electron-app/src/boundary-cli.js +++ b/ui/desktop/electron-app/src/boundary-cli.js @@ -18,8 +18,10 @@ const escapeAndValidateBase62 = (str) => { }; module.exports = { + // Check boundary cli existence exists: () => Boolean(cliPath()), + // Initiate connection and return output connect: (target_id, token, host_id) => { const addr = origin.origin; @@ -33,13 +35,13 @@ module.exports = { `-target-id=${sanitized.target_id}`, `-token=${sanitized.token}`, `-addr=${addr}`, - '-format=json', - '--output-json-errors' + '-format=json' ]; if (host_id) command.push(`-host-id=${sanitized.host_id}`) return spawnAsyncJSONPromise(command); }, + // Returns JSON-formatted version information from the CLI version: () => { const command = [ '-v' ]; @@ -54,4 +56,5 @@ module.exports = { return { gitRevision, versionNumber, formatted }; return rawOutput; } + } diff --git a/ui/desktop/electron-app/src/spawn-promise.js b/ui/desktop/electron-app/src/spawn-promise.js index ba08e2685..47afae96d 100644 --- a/ui/desktop/electron-app/src/spawn-promise.js +++ b/ui/desktop/electron-app/src/spawn-promise.js @@ -52,8 +52,10 @@ module.exports = { childProcess.stderr.on('data', (data) => { errorStream += data.toString(); const jsonData = jsonify(errorStream); - const error = jsonData ? jsonData.error : undefined; - if (jsonData) reject(new Error(error)); + if (jsonData) { + const error = jsonData.api_error || jsonData.error; + reject(new Error(error)); + } }); }); },