@@ -104,12 +104,32 @@ jobs:
104104 const fs = require('fs');
105105 const benchmarks = fs.readFileSync('BENCHMARKS.md', 'utf8');
106106 const body = `## Benchmark Results\n\n${benchmarks}`;
107- github.rest.issues.createComment({
108- issue_number: context.issue.number,
107+ const marker = '## Benchmark Results';
108+ const { data: comments } = await github.rest.issues.listComments({
109109 owner: context.repo.owner,
110110 repo: context.repo.repo,
111- body: body
111+ issue_number: context.issue.number,
112112 });
113+ const existing = comments.find(
114+ (comment) =>
115+ comment.user?.login === 'github-actions[bot]' &&
116+ comment.body?.startsWith(marker)
117+ );
118+ if (existing) {
119+ await github.rest.issues.updateComment({
120+ owner: context.repo.owner,
121+ repo: context.repo.repo,
122+ comment_id: existing.id,
123+ body,
124+ });
125+ } else {
126+ await github.rest.issues.createComment({
127+ owner: context.repo.owner,
128+ repo: context.repo.repo,
129+ issue_number: context.issue.number,
130+ body,
131+ });
132+ }
113133
114134 test :
115135 name : Test on ${{ matrix.os }} / ${{ matrix.rust }}
0 commit comments