---
title: "Update a repository variable"
method: PATCH
path: "/repos/{owner}/{repo}/actions/variables/{name}"
tags: ["actions"]
---

# Update a repository variable

`PATCH /repos/{owner}/{repo}/actions/variables/{name}`

Updates a repository 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 `actions_variables:write` repository permission to use this endpoint.
Authenticated users must have collaborator access to a repository to create, update, or read variables.

## Path parameters

- `owner` string, required
- `repo` string, required
- `name` string, required

## Request body

- object
  - `name` string — The name of the variable.
  - `value` string — The value of the variable.

## Response `204`

Response

---

[API](https://skmtc.dev/github/apis/enterprise-server.md) · [All operations](https://skmtc.dev/github/apis/enterprise-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/github/enterprise-server/revisions/4ad3e94264bd/schema)
