You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const issueBody = `The daily data refresh tests failed on ${today}. Yes, even with the snapshot updates!
226
+
227
+
Please check the [workflow run](${runUrl}) for details.
165
228
166
229
---
167
230
168
-
Want to learn more about this issue and help us fix it? Check out the [README](https://github.com/FujoWebDev/AO3.js/blob/main/README.md#about--data-refresh-tests-failed-issues) for more information!`
body: `Automatic data refresh on ${new Date().toISOString().split('T')[0]} detected changes in AO3 responses.
231
+
Want to learn more about this issue and help us fix it? Check out the [README](https://github.com/FujoWebDev/AO3.js/blob/main/README.md#about--data-refresh-tests-failed-issues) for more information!`;
232
+
233
+
if (openIssues.length > 0) {
234
+
issueNumber = openIssues[0].number;
235
+
await github.rest.issues.update({
236
+
owner: context.repo.owner,
237
+
repo: context.repo.repo,
238
+
issue_number: issueNumber,
239
+
body: issueBody,
240
+
});
241
+
await github.rest.issues.createComment({
242
+
owner: context.repo.owner,
243
+
repo: context.repo.repo,
244
+
issue_number: issueNumber,
245
+
body: `🚨 Oop, tests are STILL failing as of ${today}. The bugs persist! 🐛💪 [Workflow run](${runUrl})`,
title: '🚨 Data Refresh Tests Failed After Snapshot Update',
253
+
body: issueBody,
254
+
labels: ['data-refresh'],
255
+
});
256
+
issueNumber = issue.data.number;
257
+
core.info(`Created new issue #${issueNumber}`);
258
+
}
259
+
260
+
const prBody = `Automatic data refresh on ${today} detected changes in AO3 responses.
186
261
187
262
Despite our best efforts (in the form of a snapshot update), tests are still failing.
188
263
189
264
Manual investigation is required 🔍🕵️ To help you get started, we've created this PR with the already-updated data. May the bugs be ever in your favor! 🍀
190
265
191
-
Check the [workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.
266
+
Check the [workflow run](${runUrl}) for details.
192
267
193
268
Closes #${issueNumber}...eventually 🤞
194
269
195
270
---
196
271
197
-
Want to learn more about this issue and help us fix it? Check out the [README](https://github.com/FujoWebDev/AO3.js/blob/main/README.md#about--data-refresh-tests-failed-issues) for more information!`
198
-
});
199
-
200
-
// Add label to the PR for easy identification
201
-
await github.rest.issues.addLabels({
202
-
owner: context.repo.owner,
203
-
repo: context.repo.repo,
204
-
issue_number: pr.data.number,
205
-
labels: ['data-refresh']
206
-
});
272
+
Want to learn more about this issue and help us fix it? Check out the [README](https://github.com/FujoWebDev/AO3.js/blob/main/README.md#about--data-refresh-tests-failed-issues) for more information!`;
273
+
274
+
if (existingPRs.length > 0) {
275
+
const prNumber = existingPRs[0].number;
276
+
await github.rest.pulls.update({
277
+
owner: context.repo.owner,
278
+
repo: context.repo.repo,
279
+
pull_number: prNumber,
280
+
title: '🚨 HALP! Tests are failing after data refresh!',
281
+
body: prBody,
282
+
});
283
+
await github.rest.issues.createComment({
284
+
owner: context.repo.owner,
285
+
repo: context.repo.repo,
286
+
issue_number: prNumber,
287
+
body: `🚨 Another week, another data refresh (${today}), and the tests are still throwing a tantrum 😤 [Workflow run](${runUrl}). Someone come get their bugs! 🍀`,
288
+
});
289
+
core.info(`Updated existing PR #${prNumber}`);
290
+
} else {
291
+
const pr = await github.rest.pulls.create({
292
+
owner: context.repo.owner,
293
+
repo: context.repo.repo,
294
+
title: '🚨 HALP! Tests are failing after data refresh!',
0 commit comments