From 69bf28dd167111be953ec5a2517f94a3ac25b843 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Tue, 1 Oct 2024 03:29:07 -0400 Subject: [PATCH] fix: redactPrivateRepoCommentsadded added --- src/handlers/add-comments.ts | 2 +- src/handlers/add-issue.ts | 2 +- src/handlers/update-comments.ts | 2 +- src/handlers/update-issue.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handlers/add-comments.ts b/src/handlers/add-comments.ts index e54f9b8..e33894b 100644 --- a/src/handlers/add-comments.ts +++ b/src/handlers/add-comments.ts @@ -10,7 +10,7 @@ export async function addComments(context: Context) { const markdown = payload.comment.body; const authorId = payload.comment.user?.id || -1; const nodeId = payload.comment.node_id; - const isPrivate = context.config.redactPrivateRepoComments ? false : payload.repository.private; + const isPrivate = context.config.redactPrivateRepoComments; const issueId = payload.issue.node_id; try { diff --git a/src/handlers/add-issue.ts b/src/handlers/add-issue.ts index 642d20f..e61fa15 100644 --- a/src/handlers/add-issue.ts +++ b/src/handlers/add-issue.ts @@ -10,7 +10,7 @@ export async function addIssue(context: Context) { const markdown = payload.issue.body + " " + payload.issue.title || null; const authorId = payload.issue.user?.id || -1; const nodeId = payload.issue.node_id; - const isPrivate = !context.config.redactPrivateRepoComments && payload.repository.private; + const isPrivate = context.config.redactPrivateRepoComments; try { if (!markdown) { diff --git a/src/handlers/update-comments.ts b/src/handlers/update-comments.ts index 859063b..6c69d68 100644 --- a/src/handlers/update-comments.ts +++ b/src/handlers/update-comments.ts @@ -8,7 +8,7 @@ export async function updateComment(context: Context) { } = context; const { payload } = context as { payload: CommentPayload }; const nodeId = payload.comment.node_id; - const isPrivate = !context.config.redactPrivateRepoComments && payload.repository.private; + const isPrivate = context.config.redactPrivateRepoComments; const markdown = payload.comment.body || null; // Fetch the previous comment and update it in the db try { diff --git a/src/handlers/update-issue.ts b/src/handlers/update-issue.ts index 7495959..f163806 100644 --- a/src/handlers/update-issue.ts +++ b/src/handlers/update-issue.ts @@ -9,7 +9,7 @@ export async function updateIssue(context: Context) { const { payload } = context as { payload: IssuePayload }; const payloadObject = payload; const nodeId = payload.issue.node_id; - const isPrivate = !context.config.redactPrivateRepoComments && payload.repository.private; + const isPrivate = context.config.redactPrivateRepoComments; const markdown = payload.issue.body + " " + payload.issue.title || null; // Fetch the previous issue and update it in the db try {