Skip to content

Commit

Permalink
chore: handle github release check error
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Sep 15, 2024
1 parent c39dedd commit 1ceff8a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions packages/ci/src/publishGithubRelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@ export async function publishGithubRelease({
if (dryRun) {
console.log(`Checking release for tag ${tag}`);
} else {
const release = await octokit.repos.getReleaseByTag({
owner,
repo: repository,
tag,
});
try {
const release = await octokit.repos.getReleaseByTag({
owner,
repo: repository,
tag,
});

if (release.status === 200) {
console.log(`Release ${tag} already exists`);
return;
if (release.status === 200) {
console.log(`Release ${tag} already exists`);
return;
}
} catch (e: any) {
if (e.status !== 404) {
throw e;
}
}
}

Expand Down

0 comments on commit 1ceff8a

Please sign in to comment.