60
60
with :
61
61
name : Test262 result
62
62
path : |
63
+ ./tasks/test262/outputs.txt
63
64
./tasks/test262/failed.txt
64
65
./tasks/test262/stat.txt
65
66
# Comment stat.txt to the commit or PR
@@ -72,21 +73,38 @@ jobs:
72
73
const path = require('path');
73
74
const stat = fs.readFileSync('./tasks/test262/stat.txt', 'utf-8');
74
75
const body = stat.slice(0, 50000);
75
- if (context.issue.number) {
76
- github.rest.issues.createComment ({
76
+ (async () => {
77
+ const comments = await github.rest.issues.listComments ({
77
78
issue_number: context.issue.number,
78
79
owner: context.repo.owner,
79
80
repo: context.repo.repo,
80
- body
81
81
});
82
- } else {
83
- github.rest.repos.createCommitComment({
84
- commit_sha: context.sha,
85
- owner: context.repo.owner,
86
- repo: context.repo.repo,
87
- body
88
- });
89
- }
82
+ const existingComment = comments.data.find(comment =>
83
+ comment.body.includes('Test262 Result') && comment.user.type === 'Bot'
84
+ );
85
+ if (existingComment) {
86
+ await github.rest.issues.updateComment({
87
+ comment_id: existingComment.id,
88
+ owner: context.repo.owner,
89
+ repo: context.repo.repo,
90
+ body
91
+ });
92
+ } else if (context.issue.number) {
93
+ await github.rest.issues.createComment({
94
+ issue_number: context.issue.number,
95
+ owner: context.repo.owner,
96
+ repo: context.repo.repo,
97
+ body
98
+ });
99
+ } else {
100
+ await github.rest.repos.createCommitComment({
101
+ commit_sha: context.sha,
102
+ owner: context.repo.owner,
103
+ repo: context.repo.repo,
104
+ body
105
+ });
106
+ }
107
+ })();
90
108
91
109
e2e :
92
110
runs-on : ubuntu-latest
0 commit comments