Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.32 KB

File metadata and controls

49 lines (33 loc) · 1.32 KB

Environment / Variables API

Back to the "Environments API" | Back to the navigation

List environment variables

https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables

$variables = $client->environment()->variables()->all($repoId, $envName);

Get an environment variable

https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable

$variable = $client->environment()->variables()->show($repoId, $envName, $variableName);

Create environment variable

https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable

$client->environment()->variables()->create($repoId, $envName, [
    'name' => $name,
    'value' => $value
]);

Update environment variable

https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable

$client->environment()->variables()->update($repoId, $envName, $variableName, [
    'name' => $name,
    'value' => $value
]);

Delete an environment variable

https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable

$client->environment()->variables()->remove($repoId, $envName, $variableName);