freshness.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. name: Freshness (live drift checks)
  2. # Live staleness checks for skills that encode fast-moving external facts
  3. # (SKILL-RESOURCE-PROTOCOL.md §7). These hit the network, so they run on a
  4. # schedule — NEVER as a PR gate. A network blip / rate-limit exits 7 and is
  5. # treated as "skip, retry next run"; only a confirmed drift (exit 10) fails
  6. # the job loudly.
  7. on:
  8. schedule:
  9. - cron: "0 6 * * 1" # 06:00 UTC every Monday
  10. workflow_dispatch: {} # manual trigger
  11. permissions:
  12. contents: read
  13. jobs:
  14. drift:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v4
  18. - name: Set up Python
  19. uses: actions/setup-python@v5
  20. with:
  21. python-version: "3.x"
  22. - name: Model table vs live Models API
  23. env:
  24. ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  25. run: |
  26. set +e
  27. python skills/claude-api-ops/scripts/check-model-table.py --live
  28. rc=$?
  29. # 0 = in sync, 7 = unavailable (no key / unreachable) -> advisory skip,
  30. # 10 = drift -> fail. Anything else is a real error.
  31. if [ "$rc" -eq 10 ]; then echo "::error::model table drifted from the live Models API"; exit 1; fi
  32. if [ "$rc" -eq 7 ]; then echo "::warning::model-table live check unavailable (no key / unreachable) — skipped"; fi
  33. exit 0
  34. - name: ffmpeg-ops docs vs an installed ffmpeg
  35. run: |
  36. set +e
  37. sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg
  38. bash skills/ffmpeg-ops/scripts/verify-commands.sh --live
  39. rc=$?
  40. if [ "$rc" -eq 10 ]; then echo "::error::ffmpeg-ops docs drifted from current ffmpeg (renamed/removed filter or option)"; exit 1; fi
  41. if [ "$rc" -eq 7 ]; then echo "::warning::ffmpeg unavailable on runner — live check skipped"; fi
  42. exit 0
  43. - name: Set up Deno (JS runtime for yt-dlp YouTube extraction)
  44. # YouTube now needs a JS runtime to solve its nsig challenge; yt-dlp
  45. # auto-detects deno on PATH. Without it the smoke test can't extract and
  46. # the verifier correctly treats it as advisory-skip — but with deno the
  47. # smoke test actually exercises extraction and can catch real drift.
  48. uses: denoland/setup-deno@v2
  49. with:
  50. deno-version: v2.x
  51. - name: ytdlp-ops version age + extractor smoke test
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. run: |
  55. set +e
  56. # Runner constraint: GH-hosted images lack uv; locally prefer `uv tool install yt-dlp`.
  57. python -m pip install --quiet yt-dlp
  58. bash skills/ytdlp-ops/scripts/check-ytdlp-version.sh --live
  59. rc=$?
  60. if [ "$rc" -eq 10 ]; then echo "::error::ytdlp-ops: yt-dlp >60 days behind latest release or smoke extraction failed (extractor drift)"; exit 1; fi
  61. if [ "$rc" -eq 7 ]; then echo "::warning::ytdlp-ops live check unavailable (network/API/yt-dlp) — skipped"; fi
  62. exit 0
  63. - name: mapbox-ops facts vs live (style URLs + GL JS major)
  64. run: |
  65. set +e
  66. python skills/mapbox-ops/scripts/check-mapbox-facts.py --live
  67. rc=$?
  68. if [ "$rc" -eq 10 ]; then echo "::error::mapbox-ops drift — a third-party style URL 404'd or GL JS shipped a major past v3"; exit 1; fi
  69. if [ "$rc" -eq 7 ]; then echo "::warning::mapbox-ops live check unreachable — skipped"; fi
  70. exit 0
  71. - name: threejs-ops packages vs npm registry (existence + three major)
  72. run: |
  73. set +e
  74. python skills/threejs-ops/scripts/check-three-facts.py --live
  75. rc=$?
  76. if [ "$rc" -eq 10 ]; then echo "::error::threejs-ops drift — a committed npm package is gone, or three left the 0.<release> scheme"; exit 1; fi
  77. if [ "$rc" -eq 7 ]; then echo "::warning::threejs-ops live check unreachable (npm registry) — skipped"; fi
  78. exit 0
  79. - name: r-ops recommended packages still on CRAN
  80. run: |
  81. set +e
  82. python skills/r-ops/scripts/check-r-facts.py --live
  83. rc=$?
  84. if [ "$rc" -eq 10 ]; then echo "::error::r-ops drift — a recommended CRAN package no longer resolves (archived/removed)"; exit 1; fi
  85. if [ "$rc" -eq 7 ]; then echo "::warning::r-ops live check unreachable (CRAN/crandb) — skipped"; fi
  86. exit 0
  87. - name: isometric-ops cited packages vs npm registry
  88. run: |
  89. set +e
  90. python skills/isometric-ops/scripts/check-iso-facts.py --live
  91. rc=$?
  92. if [ "$rc" -eq 10 ]; then echo "::error::isometric-ops drift — a cited npm package is gone or renamed"; exit 1; fi
  93. if [ "$rc" -eq 7 ]; then echo "::warning::isometric-ops live check unreachable (npm registry) — skipped"; fi
  94. exit 0
  95. - name: GitHub Action refs still resolve
  96. env:
  97. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  98. run: |
  99. set +e
  100. # Scan every shipped workflow asset + the repo's own workflows.
  101. targets="skills/terraform-ops/assets/github-actions-terraform.yml .github/workflows/*.yml"
  102. bash skills/terraform-ops/scripts/check-action-refs.sh --live $targets
  103. rc=$?
  104. if [ "$rc" -eq 10 ]; then echo "::error::a GitHub Action 'uses:' ref no longer resolves"; exit 1; fi
  105. if [ "$rc" -eq 7 ]; then echo "::warning::action-ref live check rate-limited / unreachable — skipped"; fi
  106. exit 0