mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
ci: Make PR metrics comment non-blocking (no-changelog) (#28232)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
26d578dfc8
commit
b7d6b6ea17
35
.github/scripts/post-qa-metrics-comment.mjs
vendored
35
.github/scripts/post-qa-metrics-comment.mjs
vendored
|
|
@ -60,23 +60,30 @@ if (user && pass) {
|
||||||
|
|
||||||
console.log(`PR #${pr}: fetching ${metrics.join(', ')} (${baselineDays}-day baseline)`);
|
console.log(`PR #${pr}: fetching ${metrics.join(', ')} (${baselineDays}-day baseline)`);
|
||||||
|
|
||||||
const res = await fetch(webhookUrl, {
|
let res;
|
||||||
method: 'POST',
|
try {
|
||||||
headers,
|
res = await fetch(webhookUrl, {
|
||||||
body: JSON.stringify({
|
method: 'POST',
|
||||||
pr_number: pr,
|
headers,
|
||||||
github_repo: repo,
|
body: JSON.stringify({
|
||||||
git_sha: sha,
|
pr_number: pr,
|
||||||
baseline_days: baselineDays,
|
github_repo: repo,
|
||||||
metric_names: metrics,
|
git_sha: sha,
|
||||||
}),
|
baseline_days: baselineDays,
|
||||||
signal: AbortSignal.timeout(60_000),
|
metric_names: metrics,
|
||||||
});
|
}),
|
||||||
|
signal: AbortSignal.timeout(60_000),
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.warn(`Webhook unreachable, skipping metrics comment: ${err.message}`);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const text = await res.text().catch(() => '');
|
const text = await res.text().catch(() => '');
|
||||||
console.error(`Webhook failed: ${res.status} ${res.statusText}\n${text}`);
|
console.warn(`Webhook failed: ${res.status} ${res.statusText}\n${text}`);
|
||||||
process.exit(1);
|
console.warn('Skipping metrics comment.');
|
||||||
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { markdown, has_data } = await res.json();
|
const { markdown, has_data } = await res.json();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user