📦️ Build

This commit is contained in:
marocchino 2024-07-23 07:45:03 +09:00
parent 182fb2a468
commit 44e0bad810
No known key found for this signature in database
GPG key ID: F54107506CCF18D0
2 changed files with 8 additions and 2 deletions

8
dist/index.js generated vendored
View file

@ -53,6 +53,9 @@ function headerComment(header) {
function bodyWithHeader(body, header) {
return `${body}\n${headerComment(header)}`;
}
function bodyWithoutHeader(body, header) {
return body.replace(`\n${headerComment(header)}`, "");
}
function findPreviousComment(octokit, repo, number, header) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
@ -107,6 +110,9 @@ function updateComment(octokit, id, body, header, previousBody) {
return __awaiter(this, void 0, void 0, function* () {
if (!body && !previousBody)
return core.warning("Comment body cannot be blank");
const rawPreviousBody = previousBody
? bodyWithoutHeader(previousBody, header)
: "";
yield octokit.graphql(`
mutation($input: UpdateIssueCommentInput!) {
updateIssueComment(input: $input) {
@ -120,7 +126,7 @@ function updateComment(octokit, id, body, header, previousBody) {
input: {
id,
body: previousBody
? `${previousBody}\n${body}`
? bodyWithHeader(`${rawPreviousBody}\n${body}`, header)
: bodyWithHeader(body, header)
}
});

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long