Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.28 KB

createEnvironmentVariable.md

File metadata and controls

58 lines (44 loc) · 1.28 KB
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

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,
});

Parameters

name required description
repository_idyes

The unique identifier of the repository.

environment_nameyes

The name of the environment.

nameyes

The name of the variable.

valueyes

The value of the variable.

See also: GitHub Developer Guide documentation.