Skip to content

Commit

Permalink
Rethrow getTag error if not 404
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikatrix committed Jun 10, 2023
1 parent 7670b98 commit 212d4ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ function get_release_by_tag(tag, prerelease, make_latest, release_name, body, oc
yield octokit.request(getTag, Object.assign(Object.assign({}, repo()), { tag_sha: tag }));
core.warning(`Ignoring target_commit as the tag ${tag} already exists`);
}
catch (_a) { }
catch (tagError) {
if (tagError.status !== 404) {
throw tagError
}
}
}
return yield octokit.request(createRelease, Object.assign(Object.assign({}, repo()), { tag_name: tag, prerelease: prerelease, make_latest: make_latest ? 'true' : 'false', name: release_name, body: body, target_commitish: target_commit }));
}
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ async function get_release_by_tag(
tag_sha: tag
});
core.warning(`Ignoring target_commit as the tag ${tag} already exists`)
} catch { }
} catch (tagError: any) {
if (tagError.status !== 404) {
throw tagError
}
}
}
return await octokit.request(createRelease, {
...repo(),
Expand Down

0 comments on commit 212d4ba

Please sign in to comment.