Update a repo-level variable
PUT
/repos/{owner}/{repo}/actions/variables/{variablename}
const url = 'https://gitea.example.com/api/v1/repos/example/example/actions/variables/example';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"name":"example","value":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://gitea.example.com/api/v1/repos/example/example/actions/variables/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "value": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Name of the owner
repo
required
string
Name of the repository
variablename
required
string
Name of the variable
Request Body
Section titled “Request Body”UpdateVariableOption the option when updating variable
object
name
New name for the variable. If the field is empty, the variable name won’t be updated.
string
value
required
Value of the variable to update
string
Examplegenerated
{ "name": "example", "value": "example"}UpdateVariableOption the option when updating variable
object
name
New name for the variable. If the field is empty, the variable name won’t be updated.
string
value
required
Value of the variable to update
string
Responses
Section titled “Responses”Response when updating a repo-level variable
Media typeapplication/json
Response when updating a repo-level variable
Media typeapplication/json
APIError is error format response
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
APINotFound is a not found empty response
Media typeapplication/json