Skip to content

feat(actions): add org-level AI model variables#9

Merged
JacobPEvans-personal merged 1 commit into
mainfrom
feat/org-ai-model-variables
Jun 4, 2026
Merged

feat(actions): add org-level AI model variables#9
JacobPEvans-personal merged 1 commit into
mainfrom
feat/org-ai-model-variables

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

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.yml via for_each in org_settings.tf:

Variable Value
AI_MODEL openrouter/auto
AI_MODEL_CODE openai/gpt-5.4-mini
AI_MODEL_ISSUES minimax/minimax-m2.7
AI_MODEL_PLAN google/gemini-3.1-pro-preview

Why

The reusable workflows in the org's ai-workflows repo 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 literal openrouter/free — a model its OpenRouter key can't access. The docs Project 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.tf header and README both already earmarked org_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 the openrouter/free fallback.
  • 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

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
@JacobPEvans-personal JacobPEvans-personal merged commit 2a381e4 into main Jun 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant