diff --git a/src/comment-pr.ts b/src/comment-pr.ts index a2fc38b..6421bea 100644 --- a/src/comment-pr.ts +++ b/src/comment-pr.ts @@ -19,8 +19,6 @@ export async function commentPr( ): Promise { const commentContent = summary.stringify() - core.setOutput('comment-content', commentContent) - if ( config.comment_summary_in_pr === 'always' || (config.comment_summary_in_pr === 'on-failure' && @@ -29,6 +27,8 @@ export async function commentPr( return } + core.setOutput('comment-content', commentContent) + if (!github.context.payload.pull_request) { core.warning( 'Not in the context of a pull request. Skipping comment creation.'