To update environment variables defined in GitHub environment, via a GitHub action workflow we cannot use the default GITHUB_TOKEN .
GITHUB_TOKEN can interact with repository contents (depending on permissions), create releases, comment on PRs, update issues, etc.
GITHUB_TOKEN cannot update repository environments, environment secrets, or environment variables via the GitHub REST API.