Create an organization variable
POST
/orgs/{org}/actions/variables https://api.github.com
Creates an organization 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 theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
Parameters
path Path Parameters
| Name | Type |
|---|---|
org
required
The organization name. The name is not case sensitive. | string |
Request Body
application/json
required
{
name: string;
value: string;
visibility: "all" | "private" | "selected";
selected_repository_ids?: number[];
}
name: string;
value: string;
visibility: "all" | "private" | "selected";
selected_repository_ids?: number[];
}
Responses
201 application/json
Response when creating a variable
interface EmptyObject {}