mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-06 17:43:48 +00:00
feat(issue-41): set and inherit labels (#48)
fix https://github.com/kiegroup/git-backporting/issues/41
This commit is contained in:
parent
f923f7f4c2
commit
fcc01673f4
28 changed files with 962 additions and 140 deletions
|
@ -59,13 +59,26 @@ export default class GitHubClient implements GitClient {
|
|||
head: backport.head,
|
||||
base: backport.base,
|
||||
title: backport.title,
|
||||
body: backport.body
|
||||
body: backport.body,
|
||||
});
|
||||
|
||||
if (!data) {
|
||||
throw new Error("Pull request creation failed");
|
||||
}
|
||||
|
||||
if (backport.labels.length > 0) {
|
||||
try {
|
||||
await this.octokit.issues.addLabels({
|
||||
owner: backport.owner,
|
||||
repo: backport.repo,
|
||||
issue_number: (data as PullRequest).number,
|
||||
labels: backport.labels,
|
||||
});
|
||||
} catch (error) {
|
||||
this.logger.error(`Error setting labels: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (backport.reviewers.length > 0) {
|
||||
try {
|
||||
await this.octokit.pulls.requestReviewers({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue