feat: add 'open-swe' label to created pull requests (#168)

* Apply patch

* format
This commit is contained in:
Brace Sproul 2025-06-13 17:52:53 -07:00 • committed by GitHub
parent 3314821e19
commit 6c23f85eef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -518,6 +518,27 @@ export async function createPullRequest({
});
logger.info(`🐙 Pull request created: ${pullRequest.html_url}`);
// Step 3: Add the 'open-swe' label to the pull request
try {
await octokit.issues.addLabels({
owner,
repo,
issue_number: pullRequest.number,
labels: ["open-swe"],
});
logger.info(
`Added 'open-swe' label to pull request #${pullRequest.number}`,
);
} catch (labelError) {
logger.warn(
`Failed to add 'open-swe' label to pull request #${pullRequest.number}`,
{
labelError,
},
);
}
return pullRequest;
} catch (error) {
if (error instanceof Error && error.message.includes("already exists")) {