File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 8989 body = '## Release Preview\n\nNo new release will be created from this PR.\n\nThis PR does not contain conventional commits that trigger a release.';
9090 }
9191
92- github.rest.issues.createComment({
93- issue_number: context.issue.number,
92+ // Find existing comment
93+ const comments = await github.rest.issues.listComments({
9494 owner: context.repo.owner,
9595 repo: context.repo.repo,
96- body: body
96+ issue_number: context.issue.number
9797 });
98+
99+ const botComment = comments.data.find(comment =>
100+ comment.user.type === 'Bot' && comment.body.includes('## Release Preview')
101+ );
102+
103+ // Update existing or create new
104+ if (botComment) {
105+ await github.rest.issues.updateComment({
106+ owner: context.repo.owner,
107+ repo: context.repo.repo,
108+ comment_id: botComment.id,
109+ body: body
110+ });
111+ } else {
112+ await github.rest.issues.createComment({
113+ owner: context.repo.owner,
114+ repo: context.repo.repo,
115+ issue_number: context.issue.number,
116+ body: body
117+ });
118+ }
You can’t perform that action at this time.
0 commit comments