nerdexam
GitHub

GITHUB-ACTIONS · Question #18

Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)

The correct answer is A. passing the GITHUB_TOKEN secret to an action that requires a token as an input B. making an authenticated GitHub API request. Some actions may require a GITHUB_TOKEN as an input to authenticate and perform specific tasks, such as creating issues, commenting on pull requests, or interacting with the GitHub API. In such cases, you would need to explicitly pass the token to the action. When making an authe

Author and maintain workflows

Question

Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)

Options

  • Apassing the GITHUB_TOKEN secret to an action that requires a token as an input
  • Bmaking an authenticated GitHub API request
  • Cchecking out source code with the actions/checkout@v3 action
  • Dassigning non-default permissions to the GITHUB_TOKEN

How the community answered

(47 responses)
  • A
    74% (35)
  • C
    9% (4)
  • D
    17% (8)

Explanation

Some actions may require a GITHUB_TOKEN as an input to authenticate and perform specific tasks, such as creating issues, commenting on pull requests, or interacting with the GitHub API. In such cases, you would need to explicitly pass the token to the action. When making an authenticated GitHub API request, the GITHUB_TOKEN is required to authenticate the request. This token is automatically provided by GitHub in the workflow, and it must be explicitly used when interacting with the GitHub API.

Topics

#GITHUB_TOKEN#token authentication#GitHub API#explicit token usage

Community Discussion

No community discussion yet for this question.

Full GITHUB-ACTIONS Practice