From d651ef48cbbe84aa7dc1438c015601ea652ada73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Paulev=C3=A9?= Date: Tue, 10 Dec 2019 14:49:37 +0100 Subject: [PATCH] Only catch github API error (#32) * move assignements out of try block * include compiled code --- lib/github.js | 12 ++++++------ src/github.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/github.js b/lib/github.js index 58c201e..b63dd01 100644 --- a/lib/github.js +++ b/lib/github.js @@ -97,13 +97,13 @@ exports.release = (config, releaser) => __awaiter(void 0, void 0, void 0, functi } catch (error) { if (error.status === 404) { + const tag_name = tag; + const name = config.input_name || tag; + const body = util_1.releaseBody(config); + const draft = config.input_draft; + const prerelease = config.input_prerelease; + console.log(`👩‍🏭 Creating new GitHub release for tag ${tag_name}...`); try { - const tag_name = tag; - const name = config.input_name || tag; - const body = util_1.releaseBody(config); - const draft = config.input_draft; - const prerelease = config.input_prerelease; - console.log(`👩‍🏭 Creating new GitHub release for tag ${tag_name}...`); let release = yield releaser.createRelease({ owner, repo, diff --git a/src/github.ts b/src/github.ts index 582ab03..c7d43d0 100644 --- a/src/github.ts +++ b/src/github.ts @@ -136,13 +136,13 @@ export const release = async ( return release.data; } catch (error) { if (error.status === 404) { + const tag_name = tag; + const name = config.input_name || tag; + const body = releaseBody(config); + const draft = config.input_draft; + const prerelease = config.input_prerelease; + console.log(`👩‍🏭 Creating new GitHub release for tag ${tag_name}...`); try { - const tag_name = tag; - const name = config.input_name || tag; - const body = releaseBody(config); - const draft = config.input_draft; - const prerelease = config.input_prerelease; - console.log(`👩‍🏭 Creating new GitHub release for tag ${tag_name}...`); let release = await releaser.createRelease({ owner, repo,