mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-02 12:08:37 +01:00
fix(pr-validation): paginate issue comments + guard unreadable body file
Addresses review: github.rest.issues.listComments only returns the first page, so the sticky-comment marker could be missed on busy PRs — use github.paginate. And guard readFileSync so a missing/unreadable body file exits 2 (per the doc) instead of crashing without JSON.
This commit is contained in:
@@ -19,7 +19,13 @@ if (!bodyFile) {
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const body = readFileSync(bodyFile, "utf8").replace(/\r\n/g, "\n");
|
||||
let body;
|
||||
try {
|
||||
body = readFileSync(bodyFile, "utf8").replace(/\r\n/g, "\n");
|
||||
} catch (e) {
|
||||
console.error(`cannot read body file ${bodyFile}: ${e.message}`);
|
||||
process.exit(2);
|
||||
}
|
||||
const association = (process.env.AUTHOR_ASSOCIATION || "").toUpperCase();
|
||||
const isMaintainer = ["OWNER", "MEMBER", "COLLABORATOR"].includes(association);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user