Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Variable name cannot start with "GITHUB_" prefix. #60

Open
danielcshn opened this issue Oct 17, 2023 · 2 comments
Open

[Bug] Variable name cannot start with "GITHUB_" prefix. #60

danielcshn opened this issue Oct 17, 2023 · 2 comments

Comments

@danielcshn
Copy link
Contributor

Describe the bug
Variable name cannot start with "GITHUB_" prefix.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings > Environments > Add.. Environment variables > Add variable "GITHUB_TOKEN"
  2. See error: Variable name cannot start with "GITHUB_" prefix.

Expected behavior
Note: If you also want to include the private repository, register the "personal access token" in the repository and set it to GITHUB_TOKEN specified in the workflow file.

Screenshots
Captura de pantalla 2023-10-16 230851

Desktop (please complete the following information):

  • OS: Windows 11 Pro (22H2 22621.2428)
  • Browser: Google Chrome
  • Version: 117.0.5938.150 (Build oficial) (64 bits)
@danielcshn danielcshn changed the title Variable name cannot start with "GITHUB_" prefix. [Bug] Variable name cannot start with "GITHUB_" prefix. Oct 17, 2023
@PrimeEagle
Copy link

I have a fix for this issue, pending approval of the pull request.

@NarciSource
Copy link

As an environment variable, GITHUB_TOKEN cannot be overwritten because it is a reserved word.

The meaning of the sentence

If you also want to include the private repository, register the "personal access token" in the repository and set it to GITHUB_TOKEN specified in the workflow file.

is to change the value assigned to the GITHUB_TOKEN variable in GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, not secrets.GITHUB_TOKEN itself.

You can modify the workflow to change GITHUB_TOKEN: ${{ secrets.MY_PERSONAL_ACCESS_TOKEN }} and add MY_PERSONAL_ACCESS_TOKEN to the actions secrets variable.

However, a simpler way to grant access to a private repository is to adjust the permissions of secrets.GITHUB_TOKEN in the repository where this workflow is located.
For instructions, refer to this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants