Skip to content

Commit

Permalink
Only catch github API error (#32)
Browse files Browse the repository at this point in the history
* move assignements out of try block

* include compiled code
  • Loading branch information
pauleve authored and softprops committed Dec 10, 2019
1 parent 37ae175 commit d651ef4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d651ef4

Please sign in to comment.