Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

fix: refresh existing monthly metrics snapshots

Affaan Mustafabf5961e8d11f
diff --git a/.github/workflows/monthly-metrics.yml b/.github/workflows/monthly-metrics.yml
index 7d23ee7d3..27fa5973f 100644
--- a/.github/workflows/monthly-metrics.yml
+++ b/.github/workflows/monthly-metrics.yml
@@ -30,6 +30,10 @@ jobs:
return match ? Number(match[1]) : null;
}
+ function escapeRegex(value) {
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+ }
+
function fmt(value) {
if (value === null || value === undefined) return "n/a";
return Number(value).toLocaleString("en-US");
@@ -167,15 +171,18 @@ jobs:
}
const currentBody = issue.body || "";
- if (currentBody.includes(`| ${monthKey} |`)) {
- console.log(`Issue #${issue.number} already has snapshot row for ${monthKey}`);
- return;
+ const rowPattern = new RegExp(`^\\| ${escapeRegex(monthKey)} \\|.*$`, "m");
+
+ let body;
+ if (rowPattern.test(currentBody)) {
+ body = currentBody.replace(rowPattern, row);
+ console.log(`Refreshed issue #${issue.number} snapshot row for ${monthKey}`);
+ } else {
+ body = currentBody.includes("| Month (UTC) |")
+ ? `${currentBody.trimEnd()}\n${row}\n`
+ : `${intro}\n${row}\n`;
}
- const body = currentBody.includes("| Month (UTC) |")
- ? `${currentBody.trimEnd()}\n${row}\n`
- : `${intro}\n${row}\n`;
-
await github.rest.issues.update({
owner,
repo,