File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/backend/server/routes Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments