mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-13 17:52:12 +00:00
build(deps): bump @actions/github from 4.0.0 to 5.0.0 (#305)
* build(deps): bump @actions/github from 4.0.0 to 5.0.0 Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github) Signed-off-by: dependabot[bot] <support@github.com> * fix: Update @action/github 5 * build: new deps & rest fix Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: marocchino <marocchino@users.noreply.github.com>
This commit is contained in:
parent
21998583f4
commit
7874cc39cf
8 changed files with 336 additions and 167 deletions
8
lib/comment.js
generated
8
lib/comment.js
generated
|
|
@ -35,7 +35,7 @@ function headerComment(header) {
|
|||
}
|
||||
function findPreviousComment(octokit, repo, issue_number, header) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { data: comments } = yield octokit.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number }));
|
||||
const { data: comments } = yield octokit.rest.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number }));
|
||||
const h = headerComment(header);
|
||||
return comments.find(comment => { var _a; return (_a = comment.body) === null || _a === void 0 ? void 0 : _a.includes(h); });
|
||||
});
|
||||
|
|
@ -45,7 +45,7 @@ function updateComment(octokit, repo, comment_id, body, header, previousBody) {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!body && !previousBody)
|
||||
return core.warning('Comment body cannot be blank');
|
||||
yield octokit.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody
|
||||
yield octokit.rest.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody
|
||||
? `${previousBody}\n${body}`
|
||||
: `${body}\n${headerComment(header)}` }));
|
||||
});
|
||||
|
|
@ -55,7 +55,7 @@ function createComment(octokit, repo, issue_number, body, header, previousBody)
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!body && !previousBody)
|
||||
return core.warning('Comment body cannot be blank');
|
||||
yield octokit.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody
|
||||
yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody
|
||||
? `${previousBody}\n${body}`
|
||||
: `${body}\n${headerComment(header)}` }));
|
||||
});
|
||||
|
|
@ -63,7 +63,7 @@ function createComment(octokit, repo, issue_number, body, header, previousBody)
|
|||
exports.createComment = createComment;
|
||||
function deleteComment(octokit, repo, comment_id) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield octokit.issues.deleteComment(Object.assign(Object.assign({}, repo), { comment_id }));
|
||||
yield octokit.rest.issues.deleteComment(Object.assign(Object.assign({}, repo), { comment_id }));
|
||||
});
|
||||
}
|
||||
exports.deleteComment = deleteComment;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue