feat(actions): add org-level AI model variables#9
Merged
Conversation
Define AI_MODEL (+ CODE/ISSUES/PLAN tiers) as org-level GitHub Actions variables so every repo inherits them. Now that the org is a real GitHub organization, an org variable reaches every repo (public + private), replacing the per-repo fan-out and removing the need for a per-workflow literal model fallback in the reusable-workflows repo. Values live in config/actions-variables.yml; only variables actually referenced by a workflow are kept. Assisted-by: Claude:claude-opus-4-8
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.
What
Adds four org-level GitHub Actions variables so every repo in the org inherits AI model selection, decoded from a new
config/actions-variables.ymlviafor_eachinorg_settings.tf:AI_MODELopenrouter/autoAI_MODEL_CODEopenai/gpt-5.4-miniAI_MODEL_ISSUESminimax/minimax-m2.7AI_MODEL_PLANgoogle/gemini-3.1-pro-previewWhy
The reusable workflows in the org's
ai-workflowsrepo select a model via${{ vars.AI_MODEL_OPS || vars.AI_MODEL || 'openrouter/free' }}. Those model vars were only ever fanned out per-repo (to 5 repos), so any other caller (e.g.docs) had nothing to inherit and hit the literalopenrouter/free— a model its OpenRouter key can't access. ThedocsProject Router has failed 100% since ~2026-06-01 for exactly this reason.Now that the org is a real GitHub organization, an org-level variable reaches every repo (public + private), so the per-repo fan-out and the per-workflow literal fallback both become unnecessary. This PR establishes the org-level source of truth. (The
main.tfheader and README both already earmarkedorg_settings.tf (github_actions_organization_*)as next up.)Scope kept minimal
Only variables actually referenced by a workflow are defined. Dead vars (
AI_MODEL_FREE,AI_MODEL_MAX) and phantom tiers (AI_MODEL_DOCS/REVIEW/OPS, referenced but never defined) are intentionally excluded.Cost impact
Free. Org-level Actions variables incur no per-seat or metered cost on any plan or repo visibility.
Sequencing (must apply FIRST)
This is step 1 of 3. Companion PRs:
ai-workflows: native Project Router rewrite + strip theopenrouter/freefallback.secrets-sync: retire the per-repo AI-var fan-out and delete repo-level copies.Apply this PR (and confirm the org vars exist) before merging the other two, or callers briefly have no model at all. Apply requires the ORG_ADMIN token tier + S3 state creds (
aws-vault exec tf-github).Verification done
tofu fmt -check,tofu validate(backend=false),tflint,checkov,tofu test(mock providers) all pass via pre-commit.🤖 Generated with Claude Code