github-actions

Difference between github.token vs secrets.github_token?


When configuring workflows for GitHub Actions there exists the option to pass a GitHub token to authenticate towards GitHub in the workflow.

I have seen both of the following ways to get said token:

github.token
secrets.github_token

Is there any functional difference between the two? Or are these simply two ways to get the same token?


Solution

  • Both are equivalent.

    Note that these tokens have specific permissions, and that depending on what you want to do, you may need to create a Personal Access Token (PAT) and add it as a secret (ex: ACCESS_TOKEN) to use in your workflow.