Adding the possibility to auto refresh the sticky comment position... (#66)

* Allow to refresh the uniq comment position to be the latest one in the PR feed.

* Allow to refresh the uniq comment position to be the latest one in the PR feed.

* Removed "auto-" from func name
 + now defaulting new option to "false"
This commit is contained in:
vincent-joignie-dd 2023-04-14 16:09:40 +02:00 committed by GitHub
parent a65df5f64f
commit fe6766b6b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 2641 additions and 2572 deletions

View file

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createComment = exports.updateComment = exports.getExistingCommentId = void 0;
exports.createComment = exports.deleteComment = exports.updateComment = exports.getExistingCommentId = void 0;
async function getExistingCommentId(octokit, owner, repo, issueNumber, messageId) {
const parameters = {
owner,
@ -31,6 +31,16 @@ async function updateComment(octokit, owner, repo, existingCommentId, body) {
return updatedComment.data;
}
exports.updateComment = updateComment;
async function deleteComment(octokit, owner, repo, existingCommentId, body) {
const deletedComment = await octokit.rest.issues.deleteComment({
comment_id: existingCommentId,
owner,
repo,
body,
});
return deletedComment.data;
}
exports.deleteComment = deleteComment;
async function createComment(octokit, owner, repo, issueNumber, body) {
const createdComment = await octokit.rest.issues.createComment({
issue_number: issueNumber,