From the course: GitHub Actions Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Identify when to use the github_token secret

Identify when to use the github_token secret - GitHub Tutorial

From the course: GitHub Actions Cert Prep by Microsoft Press

Identify when to use the github_token secret

- [Tim] First of all, what is the secret? This is a built-in secret that's autogenerated for every repository at github.com. And you can use it. You can have actually leverage that object on your runners when you need to interact with the GitHub API directly in a secure fashion. You don't have to set up anything for this either. It's just out of the box. And so an example YAML here, let's take a look. And again, let me bring out my drawing tools again. It's a garden-variety workflow until we get to this run statement where we're making some kind of request. Looks like, "Use the GITHUB_TOKEN to access the private repository." Right, so evidently, the workflow needs to call out. It needs to make an API request using the GitHub API in order to communicate with another GitHub product. And GITHUB_TOKEN takes care of the authentication details and makes that connection happen. It would be under the security context of the GitHub user. Well, actually, that's a good question. Okay, so as it…

Contents