fix: add rootDir and types to tsconfig.json to resolve TS5011 build error

Agent-Logs-Url: https://github.com/marocchino/sticky-pull-request-comment/sessions/c726777d-ddec-4ced-8af3-0bafb048ce2f

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-05 07:34:20 +00:00 committed by GitHub
parent 6ef1707d4b
commit c4fbe28317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 546 additions and 0 deletions

68
dist/main.js generated vendored Normal file
View file

@ -0,0 +1,68 @@
import * as core from "@actions/core";
import * as github from "@actions/github";
import { commentsEqual, createComment, deleteComment, findPreviousComment, getBodyOf, minimizeComment, updateComment, } from "./comment";
import { append, deleteOldComment, getBody, githubToken, header, hideAndRecreate, hideClassify, hideDetails, hideOldComment, ignoreEmpty, onlyCreateComment, onlyUpdateComment, pullRequestNumber, recreate, repo, skipUnchanged, } from "./config";
import { validateBody, validateExclusiveModes } from "./validate";
async function run() {
if (Number.isNaN(pullRequestNumber) || pullRequestNumber < 1) {
core.info("no pull request numbers given: skip step");
return;
}
try {
validateExclusiveModes(deleteOldComment, recreate, onlyCreateComment, onlyUpdateComment, hideOldComment, hideAndRecreate);
const body = await getBody();
if (!body && ignoreEmpty) {
core.info("no body given: skip step by ignoreEmpty");
return;
}
validateBody(body, deleteOldComment, hideOldComment);
const octokit = github.getOctokit(githubToken);
const previous = await findPreviousComment(octokit, repo, pullRequestNumber, header);
core.setOutput("previous_comment_id", previous?.id);
if (!previous) {
if (onlyUpdateComment || hideOldComment || deleteOldComment) {
return;
}
const created = await createComment(octokit, repo, pullRequestNumber, body, header);
core.setOutput("created_comment_id", created?.data.id);
return;
}
if (onlyCreateComment) {
// don't comment anything, user specified only_create and there is an
// existing comment, so this is probably a placeholder / introduction one.
return;
}
if (hideOldComment) {
await minimizeComment(octokit, previous.id, hideClassify);
return;
}
if (deleteOldComment) {
await deleteComment(octokit, previous.id);
return;
}
if (skipUnchanged && commentsEqual(body, previous.body || "", header)) {
// don't recreate or update if the message is unchanged
return;
}
const previousBody = getBodyOf({ body: previous.body || "" }, append, hideDetails);
if (recreate) {
await deleteComment(octokit, previous.id);
const created = await createComment(octokit, repo, pullRequestNumber, body, header, previousBody);
core.setOutput("created_comment_id", created?.data.id);
return;
}
if (hideAndRecreate) {
await minimizeComment(octokit, previous.id, hideClassify);
const created = await createComment(octokit, repo, pullRequestNumber, body, header);
core.setOutput("created_comment_id", created?.data.id);
return;
}
await updateComment(octokit, previous.id, body, header, previousBody);
}
catch (error) {
if (error instanceof Error) {
core.setFailed(error.message);
}
}
}
run();