From 971c27cd9a458fb47e3c988fbb301560443f7fb4 Mon Sep 17 00:00:00 2001 From: Marcos Gaeta Date: Mon, 13 Jul 2020 12:04:09 -0700 Subject: [PATCH] Use a single call to getCLI --- src/main.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0841d75..a91bcaf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,8 @@ import * as validate from './validate'; (async () => { try { + const cli = getCLI(); + // Validate parameters first so we can fail early. validate.checkEnvironmentVariables(); const environment = validate.getEnvironment(); @@ -14,25 +16,25 @@ import * as validate from './validate'; const version = await validate.getVersion(); core.debug(`Version is ${version}`); - await getCLI().new(version); + await cli.new(version); core.debug(`Setting commits`); - await getCLI().setCommits(version, {auto: true}); + await cli.setCommits(version, {auto: true}); if (sourcemaps) { core.debug(`Adding sourcemaps`); - await getCLI().uploadSourceMaps(version, {include: sourcemaps}); + await cli.uploadSourceMaps(version, {include: sourcemaps}); } core.debug(`Adding deploy to release`); - await getCLI().newDeploy(version, { + await cli.newDeploy(version, { env: environment, ...(deployStartedAtOption && {started: deployStartedAtOption}), }); core.debug(`Finalizing the release`); if (shouldFinalize) { - await getCLI().finalize(version); + await cli.finalize(version); } core.debug(`Done`);