File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
packages/app/server/routes Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,24 @@ export default eventHandler(async (event) => {
230230 }
231231
232232 if ( isPullRequest ( workflowData . ref ) ) {
233+ try {
234+ const { data : pr } = await installation . request ( "GET /repos/{owner}/{repo}/pulls/{pull_number}" , {
235+ owner : workflowData . owner ,
236+ repo : workflowData . repo ,
237+ pull_number : Number ( workflowData . ref ) ,
238+ } ) ;
239+
240+ if ( pr . state !== 'open' ) {
241+ console . log ( `skipping comment on ${ pr . state } PR #${ pr . number } ` ) ;
242+ return {
243+ ok : true ,
244+ urls,
245+ } ;
246+ }
247+ } catch ( error ) {
248+ console . error ( "failed to check PR state" , error ) ;
249+ }
250+
233251 let prevComment : OctokitComponents [ "schemas" ] [ "issue-comment" ] ;
234252
235253 await installation . paginate (
You can’t perform that action at this time.
0 commit comments