GH-200 practice question 10 of 15
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)
Full set: 100 questionsThe GITHUBTOKEN is a special access token that GitHub automatically creates for use in a workflow run. Its permissions are scoped to the repository containing the workflow. It can be used to authenticate against the GitHub API for various repository-level tasks. Common use cases include creating or updating issues, publishing packages to GitHub Packages, and creating releases. The token's permissions can be customized in the workflow file to adhere to the principle of least privilege, but by default, it has sufficient permissions for these actions.
A. Leveraging a self-hosted runner involves a registration token, which is distinct from the GITHUBTOKEN used for API authentication during a workflow run.
B. The GITHUBTOKEN does not have permissions to create or manage repository secrets. This requires a personal access token (PAT) with appropriate scopes.
E. Reading from the file system is a local operation on the runner and does not require authentication against the GitHub API via the GITHUBTOKEN.
F. Adding a member to an organization is an organization-level administrative action that requires a PAT with admin:org scope, which is beyond the GITHUBTOKEN's scope.
1. GitHub Docs, "Automatic token authentication". This document states, "GitHub automatically creates a GITHUBTOKEN secret to use in your workflow... You can use the GITHUBTOKEN to authenticate in a workflow run."
2. GitHub Docs, "Permissions for the GITHUBTOKEN". This page provides a detailed table of default permissions. It shows write access for issues and packages, confirming that the token can be used to create issues and publish packages.
Keep practicing
Take the free GH-200 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GH-200 practice questions
- Question 1Which action type should be used to bundle a series of run steps into a reusable custom a…
- Question 2As a developer, which workflow steps should you perform to publish an image to the GitHub…
- Question 3Where should workflow files be stored to be triggered by events in a repository?
- Question 5Which default environment variable specifies the branch or tag that triggered a workflow?
- Question 6As a developer, what is the safest way to reference an action to prevent modification of …
- Question 7Without the need to use additional infrastructure, what is the simplest and most maintain…
