Skip to content

fix: sanitize cache-memory keys in all agentic workflows to fix git setup failures#2848

Merged
pethers merged 1 commit into
mainfrom
copilot/fix-cache-memory-issues
May 31, 2026
Merged

fix: sanitize cache-memory keys in all agentic workflows to fix git setup failures#2848
pethers merged 1 commit into
mainfrom
copilot/fix-cache-memory-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

All 14 news agentic workflows use ${{ github.workflow }} in their cache-memory key, which expands to names with colons and spaces (e.g. "News: Month Ahead"). The gh-aw setup_cache_memory_git.sh script fails with fatal: not in a git directory (exit code 128) when restoring caches written under these keys, creating a circular failure where corrupted caches never get replaced.

Changes

  • Replace ${{ github.workflow }} with filename-based slugs in all 14 news-*.md workflow source files' cache-memory.key config
  • Recompile lock files via gh aw compile --purge to regenerate all 14 .lock.yml files

Before → After

# Before (expands to "news-News: Month Ahead-today")
cache-memory:
  key: news-${{ github.workflow }}-${{ inputs.article_date || 'today' }}

# After (clean slug, no special chars)
cache-memory:
  key: news-month-ahead-${{ inputs.article_date || 'today' }}

The new key format also invalidates all previously corrupted cache entries, breaking the circular failure loop.

…ons/spaces

Replace `${{ github.workflow }}` (expands to e.g. "News: Month Ahead" with
colons and spaces) with hardcoded filename-based slugs (e.g. "news-month-ahead")
in cache-memory key configurations.

This fixes the cache-memory git repository setup failure in workflow run
26709846751 where the `setup_cache_memory_git.sh` script failed with
"fatal: not in a git directory" (exit code 128) due to corrupted cache
entries with special characters in their keys.

The new keys also invalidate any previously corrupted cache entries,
ensuring a clean start for all workflows.

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@pethers pethers marked this pull request as ready for review May 31, 2026 11:27
Copilot AI review requested due to automatic review settings May 31, 2026 11:27
Copilot AI requested a review from pethers May 31, 2026 11:27
@github-actions github-actions Bot added documentation Documentation updates workflow GitHub Actions workflows ci-cd CI/CD pipeline changes news News articles and content generation agentic-workflow Agentic workflow changes size-l Large change (250-1000 lines) labels May 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: documentation,workflow,ci-cd,size-l,news,agentic-workflow

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes gh-aw cache-memory restore/setup failures in the 14 agentic news workflows by replacing ${{ github.workflow }}-derived cache keys (which can contain spaces/colons) with stable, filename-based slugs, and regenerating the compiled .lock.yml workflows so the runtime cache restore/save keys match.

Changes:

  • Replace tools.cache-memory.key in all news-*.md workflow sources with sanitized slug keys (e.g. news-month-ahead-...).
  • Recompile all corresponding news-*.lock.yml files so actions/cache restore/save keys also use the sanitized slugs.
  • Preserve existing per-workflow key components (e.g. cycle_anchor in news-election-cycle).

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/news-year-ahead.md Use sanitized slug for cache-memory.key.
.github/workflows/news-year-ahead.lock.yml Regenerated; cache restore/save keys use news-year-ahead slug.
.github/workflows/news-weekly-review.md Use sanitized slug for cache-memory.key.
.github/workflows/news-weekly-review.lock.yml Regenerated; cache restore/save keys use news-weekly-review slug.
.github/workflows/news-week-ahead.md Use sanitized slug for cache-memory.key.
.github/workflows/news-week-ahead.lock.yml Regenerated; cache restore/save keys use news-week-ahead slug.
.github/workflows/news-translate.md Use sanitized slug for cache-memory.key.
.github/workflows/news-translate.lock.yml Regenerated; cache restore/save keys use news-translate slug.
.github/workflows/news-realtime-monitor.md Use sanitized slug for cache-memory.key.
.github/workflows/news-realtime-monitor.lock.yml Regenerated; cache restore/save keys use news-realtime-monitor slug.
.github/workflows/news-quarter-ahead.md Use sanitized slug for cache-memory.key.
.github/workflows/news-quarter-ahead.lock.yml Regenerated; cache restore/save keys use news-quarter-ahead slug.
.github/workflows/news-propositions.md Use sanitized slug for cache-memory.key.
.github/workflows/news-propositions.lock.yml Regenerated; cache restore/save keys use news-propositions slug.
.github/workflows/news-motions.md Use sanitized slug for cache-memory.key.
.github/workflows/news-motions.lock.yml Regenerated; cache restore/save keys use news-motions slug.
.github/workflows/news-monthly-review.md Use sanitized slug for cache-memory.key.
.github/workflows/news-monthly-review.lock.yml Regenerated; cache restore/save keys use news-monthly-review slug.
.github/workflows/news-month-ahead.md Use sanitized slug for cache-memory.key.
.github/workflows/news-month-ahead.lock.yml Regenerated; cache restore/save keys use news-month-ahead slug.
.github/workflows/news-interpellations.md Use sanitized slug for cache-memory.key.
.github/workflows/news-interpellations.lock.yml Regenerated; cache restore/save keys use news-interpellations slug.
.github/workflows/news-evening-analysis.md Use sanitized slug for cache-memory.key.
.github/workflows/news-evening-analysis.lock.yml Regenerated; cache restore/save keys use news-evening-analysis slug.
.github/workflows/news-election-cycle.md Use sanitized slug for cache-memory.key while keeping cycle_anchor component.
.github/workflows/news-election-cycle.lock.yml Regenerated; cache restore/save keys use news-election-cycle slug + cycle_anchor.
.github/workflows/news-committee-reports.md Use sanitized slug for cache-memory.key.
.github/workflows/news-committee-reports.lock.yml Regenerated; cache restore/save keys use news-committee-reports slug.

@pethers pethers merged commit 29e0ad0 into main May 31, 2026
14 checks passed
@pethers pethers deleted the copilot/fix-cache-memory-issues branch May 31, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes documentation Documentation updates news News articles and content generation size-l Large change (250-1000 lines) workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants