GitHub Actions Minute Control Runbook
SharedOperations725 words4 min read
Purpose
Phần tiêu đề “Purpose”- Giữ GitHub-hosted Actions ở mức đủ dùng, không đốt quota vì cron dày hoặc failure loop.
- Là file ngắn để AI và owner dùng lại khi sửa
.github/workflows/**.
Khi nào phải đọc
Phần tiêu đề “Khi nào phải đọc”- Khi thêm hoặc sửa workflow trong
.github/workflows/**. - Khi repo private bị chạm quota, billing limit, hoặc có failure loop từ scheduled workflows.
- Khi muốn thêm automation mới cho reminder, sync, reconcile, deploy, hoặc review queue.
Hard rules
Phần tiêu đề “Hard rules”- Repo private không dùng cron dày hơn
6 giờ/lầnnếu chưa có owner approval rõ ràng. - Ưu tiên
push,repository_dispatch, hoặc trigger thủ công hơnschedule. - Workflow kiểu reminder/inbox không chạy
24/7; mặc định chỉ chạythứ 2-6và tối đa2 lần/ngày. - Mọi scheduled workflow phải có đủ:
workflow_dispatchconcurrency.cancel-in-progress: truetimeout-minutes
- Mọi early-exit phải xảy ra trước
setup-node,npm ci, build, hoặc network-heavy steps nếu có thể. - Không tạo thêm job
notify-failureriêng cho cron trừ khi alert đó quan trọng hơn chi phí; mặc định chỉ alert ở manual lane. - Tổng baseline từ tất cả cron trong repo private phải thấp hơn
25%quota tháng. Nếu vượt, giảm lịch trước khi thêm workflow mới. - Khi billing bị block hoặc quota cạn, ưu tiên disable workflow scheduled trên GitHub remote thay vì để nó fail lặp.
Current paused set
Phần tiêu đề “Current paused set”- Trạng thái khẩn cấp hiện tại: pause scheduled workflows đến kỳ reset Actions vào
2026-04-01. - Disabled manually:
Auto Sync External Docs To RepoReview InboxHigh Risk SLA ReminderGovernance Weekly ReportReconcile Doc Artifact Driftở repodol-wiki
Re-enable after reset
Phần tiêu đề “Re-enable after reset”gh workflow enable "Auto Sync External Docs To Repo" -R wblekhoa/DOL-Education-Documentationgh workflow enable "Review Inbox" -R wblekhoa/DOL-Education-Documentationgh workflow enable "High Risk SLA Reminder" -R wblekhoa/DOL-Education-Documentationgh workflow enable "Governance Weekly Report" -R wblekhoa/DOL-Education-Documentationgh workflow enable "Reconcile Doc Artifact Drift" -R wblekhoa/dol-wikiManual ship window
Phần tiêu đề “Manual ship window”- Áp dụng từ bây giờ đến khi scheduled workflows được bật lại.
- Mục tiêu: vẫn ship được thay đổi cần thiết, nhưng không phụ thuộc vào scheduled GitHub Actions.
Lane 1: Manual docs commit
Phần tiêu đề “Lane 1: Manual docs commit”- Dùng khi thay đổi nằm chủ yếu ở
docs/**hoặcopenspec/**trong repo docs. - Flow mặc định:
cd "DOL Education Documentation"npm run collab:quick:checknpm run ai:ship:preview- nếu preview đúng scope,
npm run ai:ship:push
- Nếu thay đổi chạm workflow, root governance docs, hoặc file ngoài scope docs:
- dùng
npm run ai:ship:all:preview - rồi
npm run ai:ship:all:push
- dùng
Lane 2: Manual wiki verify
Phần tiêu đề “Lane 2: Manual wiki verify”- Dùng khi cần chắc nội dung docs hiện tại render/bundle ổn ở wiki.
- Flow tối thiểu:
cd "DOL Wiki/site"npm run verify:assets
- Nếu cần release-grade confidence:
npm run verify:release:style- hoặc
npm run verify:release
Lane 3: Manual artifact publish
Phần tiêu đề “Lane 3: Manual artifact publish”- Dùng khi docs đã đổi và cần publish lại
doc-artifactsmà không chờ reconcile cron. - Thực hiện từ repo
DOL Wiki/sitesau khi verify:npm run syncnpm run build:artifacts:fullnode ./scripts/publish-doc-artifacts.mjs --dir ./.cache/doc-artifacts || node ./scripts/publish-doc-artifacts.mjsnode ./scripts/purge-cache-paths.mjs
- Chỉ chạy lane này khi credentials Cloudflare/R2 đã sẵn sàng trong local env.
Lane 4: Manual deploy
Phần tiêu đề “Lane 4: Manual deploy”- GitHub Pages deploy qua GitHub-hosted Actions vẫn có thể bị block khi billing chưa reset.
- Safe default trong giai đoạn này:
- commit/push thủ công trước
- chỉ deploy khi có yêu cầu rõ từ owner cho từng lần ship
- ưu tiên lane local đã có sẵn trong repo hơn là bật lại cron
- Nếu cần thử local Cloudflare lane từ repo
DOL Wiki/site:npm run deploy:cf
- Chỉ coi deploy là hoàn tất sau khi có bằng chứng URL/endpoint đã lên bản mới.
Default schedules now
Phần tiêu đề “Default schedules now”Auto Sync External Docs To Repo:17 */6 * * *Review Inbox:15 2,9 * * 1-5High Risk SLA Reminder:0 3 * * 1-5Governance Weekly Report:0 1 * * 1Reconcile Doc Artifact Drift:47 */6 * * *
Decision shortcut
Phần tiêu đề “Decision shortcut”- Nếu workflow không cần gần realtime: tăng interval.
- Nếu workflow chỉ để “fallback consistency”: giữ schedule thưa, còn lane chính phải là event-driven.
- Nếu workflow fail vì môi trường hoặc billing: pause remote trước, debug sau.