Create an organization Actions variable and scope it to selected repositories via the GitHub REST API

domain: docs.github.com · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Call POST https://api.github.com/orgs/{org}/actions/variables with admin:org scope (plus repo for private repos).
  2. Send body {"name", "value", "visibility"} where visibility is all, private, or selected.
  3. For visibility=selected, include selected_repository_ids (array of int repo IDs).
  4. A 201 Created returns the variable with its name, value, created_at, updated_at, and visibility.
  5. Adjust scoping later via PATCH /orgs/{org}/actions/variables/{name} or the replace-all selected-repositories endpoint.

Known gotchas

Related routes

Create a repository Actions variable via the GitHub REST API (non-secret config)
docs.github.com · 5 steps · unrated
Create or update an organization Actions secret with visibility scoping via the GitHub REST API
docs.github.com · 5 steps · unrated
List repository Actions variables via the GitHub REST API
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans