Skip to content
Discussion options

You must be logged in to vote

One thing worth adding to what's been said: if this is running inside a GitHub Actions workflow using the default GITHUB_TOKEN, that token can't update repository variables regardless of scopes. Updating variables via the API from within a workflow requires a PAT or a GitHub App token with the right permissions.

For fine-grained PATs, the specific permission you need is "Variables" (Read and Write) under Repository permissions. It's easy to miss because it's separate from the general actions scope.

Quick way to isolate the issue: run the call manually from your local machine:

curl -X PATCH \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ap3-sf
Comment options

Answer selected by ap3-sf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apps API and Webhooks Discussions related to GitHub's APIs or Webhooks Question Ask and answer questions about GitHub features and usage
3 participants