Spaces:
Running
Running
Commit ·
5e2010f
1
Parent(s): 216c813
Add Friday heartbeat Teams notification when no leaderboard changes
Browse filesOn Fridays when the sync finds no changes, post an info card to Teams
showing the last date leaderboard.json was actually changed. Confirms
the automation is running even during quiet weeks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
.claude/skills/sync-nowai-leaderboard/sync.mjs
CHANGED
|
@@ -108,6 +108,25 @@ async function main() {
|
|
| 108 |
// 4. Change detection.
|
| 109 |
if (!hasChanges(oldData, newData)) {
|
| 110 |
console.log('[sync] no display changes. Done.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
return;
|
| 112 |
}
|
| 113 |
const changeLines = diffBoards(oldData, newData);
|
|
|
|
| 108 |
// 4. Change detection.
|
| 109 |
if (!hasChanges(oldData, newData)) {
|
| 110 |
console.log('[sync] no display changes. Done.');
|
| 111 |
+
// Friday heartbeat: post a card so the Teams channel confirms the job is alive
|
| 112 |
+
// even during quiet weeks with no ranking changes.
|
| 113 |
+
if (new Date().getDay() === 5) {
|
| 114 |
+
let lastChanged = 'unknown';
|
| 115 |
+
try {
|
| 116 |
+
lastChanged = git(root, ['log', '-1', '--format=%as', '--', 'data/leaderboard.json']).trim() || 'unknown';
|
| 117 |
+
} catch (_) {}
|
| 118 |
+
await postTeams({
|
| 119 |
+
kind: 'info',
|
| 120 |
+
title: '📋 Leaderboard sync — no changes this week',
|
| 121 |
+
subtitle: subtitle(),
|
| 122 |
+
facts: [
|
| 123 |
+
['Status', 'Up to date — no ranking changes detected'],
|
| 124 |
+
['Last changed', lastChanged],
|
| 125 |
+
],
|
| 126 |
+
openUrl: STAGING_URL,
|
| 127 |
+
openLabel: 'Open staging',
|
| 128 |
+
});
|
| 129 |
+
}
|
| 130 |
return;
|
| 131 |
}
|
| 132 |
const changeLines = diffBoards(oldData, newData);
|