mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-06-07 05:44:29 -04:00
feat(issue-70): additional pr comments
This commit is contained in:
parent
10a46551ee
commit
bed7e29ddc
20 changed files with 424 additions and 16 deletions
|
@ -117,6 +117,19 @@ export default class GitHubClient implements GitClient {
|
|||
);
|
||||
}
|
||||
|
||||
if (backport.comments.length > 0) {
|
||||
backport.comments.forEach(c => {
|
||||
promises.push(
|
||||
this.octokit.issues.createComment({
|
||||
owner: backport.owner,
|
||||
repo: backport.repo,
|
||||
issue_number: (data as PullRequest).number,
|
||||
body: c,
|
||||
}).catch(error => this.logger.error(`Error posting comment: ${error}`))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
return data.html_url;
|
||||
|
|
|
@ -96,6 +96,18 @@ export default class GitLabClient implements GitClient {
|
|||
);
|
||||
}
|
||||
|
||||
// comments
|
||||
if (backport.comments.length > 0) {
|
||||
this.logger.info("Posting comments: " + backport.comments);
|
||||
backport.comments.forEach(c => {
|
||||
promises.push(
|
||||
this.client.post(`/projects/${projectId}/merge_requests/${mr.iid}/notes`, {
|
||||
body: c,
|
||||
}).catch(error => this.logger.warn("Failure trying to post comment. " + error))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// reviewers
|
||||
const reviewerIds = await Promise.all(backport.reviewers.map(async r => {
|
||||
this.logger.debug("Retrieving user: " + r);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue