Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 27, 2024
1 parent fd4f8aa commit e34766b
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/supersetbot/src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,22 @@ class Github {
await runShellCommand({ command: `git push -f origin ${branchName}`, ...shellOptions });
const existingPRs = await this.searchExistingPRs(branchName);
if (existingPRs.length === 0) {
// Create a PR
this.octokit.pulls.create({
...this.unPackRepo(),
title: commitMessage,
head: branchName,
labels: ['supersetbot'],
base: 'master',
body: `Updates the python "${pythonPackage}" library version. \n\nGenerated by @supersetbot 🦾`,
})
.then(({ data }) => {
console.log(`Pull request created: ${data.html_url}`);
return data.html_url;
try {
// Create a PR
const resp = await this.octokit.pulls.create({
...this.unPackRepo(),
title: commitMessage,
head: branchName,
labels: ['supersetbot'],
base: 'master',
body: `Updates the python "${pythonPackage}" library version. \n\nGenerated by @supersetbot 🦾`,
})
.catch(console.error);
console.log(`Pull request created: ${resp.data.html_url}`);
return resp.data.html_url;
} catch (error) {
console.error(error);
throw error; // Rethrow the error if you want the caller to handle it
}
} else {
console.log('PR already exists:', existingPRs[0].html_url);
}
Expand Down

0 comments on commit e34766b

Please sign in to comment.