Skip to content

Commit a1a385a

Browse files
committed
init
1 parent bf8c148 commit a1a385a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/backend/server/routes/publish.post.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,19 @@ export default eventHandler(async (event) => {
229229
);
230230

231231
if (comment !== "off") {
232-
if (comment === "update" && prevComment!) {
232+
const { data: permissions } = await installation.request(
233+
"GET /repos/{owner}/{repo}/installation",
234+
{
235+
owner: workflowData.owner,
236+
repo: workflowData.repo,
237+
}
238+
);
239+
240+
if (permissions.permissions.issues !== 'write') {
241+
console.warn(
242+
`No permission to create comments in ${workflowData.owner}/${workflowData.repo}:${workflowData.ref}`,
243+
);
244+
} else if (comment === "update" && prevComment!) {
233245
await installation.request(
234246
"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}",
235247
{

0 commit comments

Comments
 (0)