Only catch github API error (#32)

* move assignements out of try block

* include compiled code
This commit is contained in:
Loïc Paulevé 2019-12-10 14:49:37 +01:00 committed by Doug Tangren
parent 37ae175992
commit d651ef48cb
2 changed files with 12 additions and 12 deletions

View File

@ -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,

View File

@ -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,