Sample - GitHub REST API
POST/repos/{owner}/{repo}/actions/variables

Create a repository variable

Creates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 2 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
namestringrequired
The name of the variable.
valuestringrequired
The value of the variable.

1 status code
201Response