name | example | route | scope | type |
---|---|---|---|---|
Create an environment variable |
octokit.rest.actions.createEnvironmentVariable({ repository_id, environment_name, name, value }) |
POST /repositories/{repository_id}/environments/{environment_name}/variables |
actions |
API method |
Create an environment variable that you can reference in a GitHub Actions workflow.
You must authenticate using an access token with the repo
scope to use this endpoint.
GitHub Apps must have the environment:write
repository permission to use this endpoint.
octokit.rest.actions.createEnvironmentVariable({
repository_id,
environment_name,
name,
value,
});
name | required | description |
---|---|---|
repository_id | yes |
The unique identifier of the repository. |
environment_name | yes |
The name of the environment. |
name | yes |
The name of the variable. |
value | yes |
The value of the variable. |
See also: GitHub Developer Guide documentation.