Skip to content

Commit 4f955ba

Browse files
authored
Merge pull request #1873 from Hack23/copilot/fix-code-push-failure
Unstage `analysis/data/` in news workflows to prevent E003 PR-size failure
2 parents 9e24f80 + f190a08 commit 4f955ba

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/news-committee-reports.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ fi
460460
# With --limit 50, documents/ alone can contain 100+ files (50 JSON + 50 analysis.md).
461461
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.md 2>/dev/null || true
462462
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.json 2>/dev/null || true
463+
# 🚨 HARD UNSTAGE: NEVER commit analysis/data/ — it is an MCP response cache populated by
464+
# download-parliamentary-data.ts (6 doc types × ~40 files = 240+ files). It must stay local.
465+
# Committing it caused E003 "received 258 files" in news-motions run 24653843681 (PR #1867).
466+
# Only news-realtime-monitor stages analysis/data/ intentionally; this workflow never should.
467+
# 🚫 DO NOT run `git add analysis/data/...` anywhere in this workflow.
468+
git reset HEAD -- analysis/data/ 2>/dev/null || true
463469
# Enforce safe-outputs 100-file PR limit (AWF-safe: no $(...) — write to temp file + read back)
464470
git diff --cached --name-only > /tmp/staged_files.txt
465471
awk 'END{print NR}' /tmp/staged_files.txt > /tmp/staged_count.txt

.github/workflows/news-interpellations.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ fi
477477
# With --limit 50, documents/ alone can contain 100+ files (50 JSON + 50 analysis.md).
478478
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.md 2>/dev/null || true
479479
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.json 2>/dev/null || true
480+
# 🚨 HARD UNSTAGE: NEVER commit analysis/data/ — it is an MCP response cache populated by
481+
# download-parliamentary-data.ts (6 doc types × ~40 files = 240+ files). It must stay local.
482+
# Committing it caused E003 "received 258 files" in news-motions run 24653843681 (PR #1867).
483+
# Only news-realtime-monitor stages analysis/data/ intentionally; this workflow never should.
484+
# 🚫 DO NOT run `git add analysis/data/...` anywhere in this workflow.
485+
git reset HEAD -- analysis/data/ 2>/dev/null || true
480486
# Enforce safe-outputs 100-file PR limit (AWF-safe: no $(...) — write to temp file + read back)
481487
git diff --cached --name-only > /tmp/staged_files.txt
482488
awk 'END{print NR}' /tmp/staged_files.txt > /tmp/staged_count.txt

.github/workflows/news-motions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ Branch: `news/content/{YYYY-MM-DD}/{article-type}` (e.g. `news/content/2026-03-2
462462
# CRITICAL: Stage ONLY today's new articles (EN/SV), NOT all existing news/
463463
# Staging news/*motions*.html would include 360+ existing files, many of which
464464
# may have been modified by auto-fix scripts, causing E003 (>100 files) PR failure.
465+
# 🚫 DO NOT add `analysis/data/` anywhere — it contains 200+ MCP response cache files
466+
# (documents/{motions,interpellations,committeeReports,propositions,questions,speeches}/)
467+
# populated by download-parliamentary-data.ts. Only run the `git add` lines shown below.
465468
git add "news/$ARTICLE_DATE-opposition-motions-en.html" 2>/dev/null || true
466469
git add "news/$ARTICLE_DATE-opposition-motions-sv.html" 2>/dev/null || true
467470
git add news/metadata/ 2>/dev/null || true
@@ -473,6 +476,12 @@ fi
473476
# With --limit 50, documents/ alone can contain 100+ files (50 JSON + 50 analysis.md).
474477
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.md 2>/dev/null || true
475478
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.json 2>/dev/null || true
479+
# 🚨 HARD UNSTAGE: NEVER commit analysis/data/ — it is an MCP response cache populated by
480+
# download-parliamentary-data.ts (6 doc types × ~40 files = 240+ files). It must stay local.
481+
# Committing it caused E003 "received 258 files" in run 24653843681 (PR #1867). Only
482+
# news-realtime-monitor stages analysis/data/ intentionally; news-motions never should.
483+
# 🚫 DO NOT run `git add analysis/data/...` anywhere in this workflow.
484+
git reset HEAD -- analysis/data/ 2>/dev/null || true
476485
# Enforce safe-outputs 100-file PR limit (AWF-safe: no $(...) — write to temp file + read back)
477486
git diff --cached --name-only > /tmp/staged_files.txt
478487
awk 'END{print NR}' /tmp/staged_files.txt > /tmp/staged_count.txt

.github/workflows/news-propositions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,12 @@ fi
465465
# With --limit 50, documents/ alone can contain 100+ files (50 JSON + 50 analysis.md).
466466
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.md 2>/dev/null || true
467467
git add "analysis/daily/$ARTICLE_DATE/$ANALYSIS_SUBFOLDER"/*.json 2>/dev/null || true
468+
# 🚨 HARD UNSTAGE: NEVER commit analysis/data/ — it is an MCP response cache populated by
469+
# download-parliamentary-data.ts (6 doc types × ~40 files = 240+ files). It must stay local.
470+
# Committing it caused E003 "received 258 files" in news-motions run 24653843681 (PR #1867).
471+
# Only news-realtime-monitor stages analysis/data/ intentionally; this workflow never should.
472+
# 🚫 DO NOT run `git add analysis/data/...` anywhere in this workflow.
473+
git reset HEAD -- analysis/data/ 2>/dev/null || true
468474
# Enforce safe-outputs 100-file PR limit (AWF-safe: no $(...) — write to temp file + read back)
469475
git diff --cached --name-only > /tmp/staged_files.txt
470476
awk 'END{print NR}' /tmp/staged_files.txt > /tmp/staged_count.txt

0 commit comments

Comments
 (0)