feat: Automate nightly news article generation with MCP integration#345
Closed
feat: Automate nightly news article generation with MCP integration#345
Conversation
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Automate nightly news article generation with MCP integration
feat: Automate nightly news article generation with MCP integration
Feb 19, 2026
pethers
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual article creation for 14 languages consumed 2–4 hours daily and was error-prone. This adds a fully automated nightly pipeline: fetch → threshold → generate → validate → PR.
New files
scripts/generate-daily-news.js— Orchestrator that queriesriksdag-regering-mcpfor documents published since yesterday, groups by type (bet/prop/mot), skips types below the minimum document threshold (default ≥5), and delegates HTML generation to the existinggenerate-news-enhanced.jsengine. Week Ahead is always generated..github/workflows/nightly-news-generation.yml— Scheduled at 02:00 CET (0 1 * * *). All actions SHA-pinned. Supportsworkflow_dispatchwith inputs fordate,threshold,languages,types, anddry_run. Runs HTMLHint on generated files, updates indexes/sitemap, and opens a labeled PR viapeter-evans/create-pull-request@v8.1.0.ARTICLE_ENHANCEMENT_GUIDE.md— Definitive 892-line reference consolidating patterns from Issues Enhance Committee Reports Articles with Full Data Analysis and Commentary (2026-02-10 to 2026-02-14) #306–334 (176 articles enhanced). Covers: all 32 MCP tool call examples, 150–400 word quality standards, The Economist style guidelines, 14-language translation order and RTL requirements, Schema.org synchronization requirements, index/sitemap update process, and 8 documented pitfalls (cold-start handling, professional translation safety guards, 1 MB patch-size limit, etc.).package.jsonAdded
generate-daily-newsnpm script entry pointing to the new orchestrator.Original prompt
This section details on the original issue you should resolve
<issue_title>Automate Nightly News Article Generation with MCP Integration</issue_title>
<issue_description># 📋 Issue Type
Automation / Process Improvement
🎯 Objective
Create automated nightly news generation script that fetches latest Riksdag documents via MCP and generates enhanced articles with proper analysis automatically, eliminating manual article creation.
📊 Current State
Manual Process: Articles are created manually or semi-manually:
Problem: Time-consuming, error-prone, inconsistent quality
🚀 Desired State
Automated Workflow:
🔧 Implementation Approach
Step 1: Create Generation Script
File:
scripts/generate-daily-news.jsStep 2: GitHub Actions Workflow
File:
.github/workflows/nightly-news-generation.ymlStep 3: Quality Controls
✅ Acceptance Criteria
scripts/generate-daily-news.jscreated.github/workflows/nightly-news-generation.yml📚 References
scripts/generate-news-enhanced.js(partial implementation).github/copilot-mcp.jsonscripts/translate-committee-reports.py🤖 Recommended Agent
devops-engineer or data-pipeline-specialist
📝 Notes
High value: Eliminates 2-4 hours of manual work daily. Ensures consistent quality and timely publication. Reduces human error.
Dependencies: Should implement after Issue #338 (documentation) to follow proven patterns.
Timeline: 3-5 days</issue_description>
<agent_instructions>Create comprehensive ARTICLE_ENHANCEMENT_GUIDE.md documenting the complete workflow from Issues #306-334. Include: step-by-step process, all 32 MCP tool examples, content quality standards (150-400 words), translation workflow for 14 languages, validation steps, best practices, and common pitfalls. Reference successful PRs #307, #312, #313, #314, #326, #333, #334. Make it a definitive guide for future article generation.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.