feat(ci): add limit-aware actions bootstrap for new projects#127
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a comprehensive GitHub Actions budget management framework for organizations and projects. It adds organization-level setup scripts, project bootstrap enhancements with limit-aware CI templates, and documentation on implementing Actions spending controls through configurable caps, warning thresholds, and degradation modes for non-critical jobs. Changes
Sequence Diagram(s)sequenceDiagram
actor Admin
participant OrgSetup as actions-org-setup.sh
participant GitHubAPI as GitHub API
participant Project as project.sh
participant ProjectRepo as Project Repository
participant Workflow as GitHub Workflow (CI)
participant BudgetGuard as Budget Guard
Admin->>OrgSetup: --org MYORG --actions-cap-minutes 1000 ...
OrgSetup->>GitHubAPI: Validate auth & permissions
OrgSetup->>GitHubAPI: Query current Actions usage
OrgSetup->>GitHubAPI: Upsert ACTIONS_MONTHLY_CAP_MINUTES
OrgSetup->>GitHubAPI: Upsert ACTIONS_WARN_PCT
OrgSetup->>GitHubAPI: Upsert ACTIONS_DEGRADE_PCT
OrgSetup-->>Admin: ✓ Org configured
Admin->>Project: --project-name my-app --ci-profile limit-aware --org MYORG ...
Project->>ProjectRepo: Create project structure
Project->>ProjectRepo: Generate .github/workflows/ci.yml from template
Project->>ProjectRepo: Generate .github/workflows/security-nightly.yml
Project->>ProjectRepo: Render org/cap/warn/degrade into workflow files
Project-->>Admin: ✓ Project bootstrapped
Admin->>ProjectRepo: Push to GitHub
ProjectRepo->>Workflow: Trigger on push/PR
Workflow->>BudgetGuard: Check ACTIONS_MONTHLY_CAP_MINUTES usage
alt Within Budget
BudgetGuard-->>Workflow: degrade_mode=false
Workflow->>Workflow: Run all jobs (baseline + heavy)
else Approaching Limit
BudgetGuard-->>Workflow: degrade_mode=true, warn=true
Workflow->>Workflow: Run baseline only, skip heavy jobs
Workflow->>Workflow: Append warning to summary
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Project Scorecard |
|



Summary
node,nextjs, andpythonproject bootstrapsscripts/bootstrap/actions-org-setup.shto validate org settings, query usage, and upsert Actions budget variablesscripts/bootstrap/project.shto default to--ci-profile=limit-awareand require--org+--actions-cap-minutesorganization-setup, newactions-limits-strategy) and README/CHANGELOGValidation
bash -n scripts/bootstrap/project.shbash -n scripts/bootstrap/actions-org-setup.shshellcheck scripts/bootstrap/project.sh scripts/bootstrap/actions-org-setup.sh*.yml.tpl)node,nextjs,pythonwith generated workflow assertionsnpm run lintnpm run buildnpm testSummary by CodeRabbit
New Features
Documentation
Changed