Skip to content

Commit

Permalink
chore: improves create PR error handling (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance authored Oct 10, 2024
1 parent e78564f commit ac26607
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/scripts/src/addOrbitChain/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,17 @@ export const commitChangesAndCreatePR = async (
console.log("Changes committed successfully");
const issue = await getIssue(process.env.ISSUE_NUMBER!);
console.log("Creating pull request...");
await createPullRequest(branchName, orbitChain.name, issue.html_url);
console.log("Pull request created successfully");
await createPullRequest(branchName, orbitChain.name, issue.html_url)
.catch((err) => {
if (err.message.includes("A pull request already exists")) {
console.log("Pull request already exists.");
} else {
throw err;
}
})
.then(() => {
console.log("Pull request created successfully");
});
core.endGroup();
};

Expand Down

0 comments on commit ac26607

Please sign in to comment.