Skip to content

Commit b2e9316

Browse files
fix comments
1 parent 2ef12bc commit b2e9316

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

.github/workflows/a11y-contrast.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,25 @@ jobs:
111111
});
112112
113113
const possibleTitles = [
114-
'❌ light:',
115-
'❌ light_high_contrast:',
116-
'❌ light_colorblind:',
117-
'❌ light_tritanopia:',
118-
'❌ dark:',
119-
'❌ dark_dimmed:',
120-
'❌ dark_high_contrast:',
121-
'❌ dark_colorblind:',
122-
'❌ dark_tritanopia:'
114+
'❌ `light`:',
115+
'❌ `light_high_contrast`:',
116+
'❌ `light_colorblind`:',
117+
'❌ `light_tritanopia`:',
118+
'❌ `dark`:',
119+
'❌ `dark_dimmed`:',
120+
'❌ `dark_high_contrast`:',
121+
'❌ `dark_colorblind`:',
122+
'❌ `dark_tritanopia`:'
123123
]
124124
125125
// get comments of token issues
126-
const currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart)));
126+
let currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart)));
127127
128128
for (const {title, body} of results) {
129129
// get token issue
130130
const titleStart = title.substring(0, title.indexOf(':') + 1);
131131
// remove from currentComments
132-
132+
currentComments = currentComments.filter(comment => !comment.body.includes(titleStart));
133133
//
134134
const tokenCheckComment = comments.filter(comment => comment.body.includes(titleStart));
135135
const outputBody = `${title}\n\n${body}\n\n<a href="${WORKFLOW_SUMMARY_URL}">→ Details</a>`
@@ -158,6 +158,7 @@ jobs:
158158
// if token issue exists, update it
159159
if(currentComments.length > 0) {
160160
await currentComments.map(comment => {
161+
console.log('deleting comment', comment.id, comment)
161162
github.rest.issues.deleteComment({
162163
comment_id: comment.id,
163164
owner: context.repo.owner,
@@ -195,15 +196,15 @@ jobs:
195196
});
196197
197198
const possibleTitles = [
198-
'❌ light:',
199-
'❌ light_high_contrast:',
200-
'❌ light_colorblind:',
201-
'❌ light_tritanopia:',
202-
'❌ dark:',
203-
'❌ dark_dimmed:',
204-
'❌ dark_high_contrast:',
205-
'❌ dark_colorblind:',
206-
'❌ dark_tritanopia:'
199+
'❌ `light`:',
200+
'❌ `light_high_contrast`:',
201+
'❌ `light_colorblind`:',
202+
'❌ `light_tritanopia`:',
203+
'❌ `dark`:',
204+
'❌ `dark_dimmed`:',
205+
'❌ `dark_high_contrast`:',
206+
'❌ `dark_colorblind`:',
207+
'❌ `dark_tritanopia`:'
207208
]
208209
209210
// get token issue

0 commit comments

Comments
 (0)