GH-200 Practice Test

GH-200 Practice Test practice questions, page 3 of 5, with answer review and explanations.

Question 11

How should you install the bats NPM package in your workflow?

Question 12

What is the most secure way to store sensitive information in GitHub Actions workflows?

  1. Use environment variables in the workflow and store sensitive data directly in the variables.
  2. From the GitHub repository settings, store sensitive data as unencrypted text.
  3. Store the sensitive information as plain text in the workflow YAML file.
  4. Use GitHub Enterprise Managed User (OIDC) integration to dynamically fetch secrets from a third-party secrets manager.

Question 13

You create a self-hosted runner labeled as runner1. You need to ensure that a GitHub Actions workflow job runs only on runner1. Which YAML statement should you use?

  1. runs-on: [self-hosted, linux-xlarge]
  2. runs-on: - self-hosted - ubuntu-latest
  3. runs-on: [self-hosted, runner1]
  4. runs-on: self-hosted

Question 14

What is a role of GitHub Marketplace when using GitHub Actions?

  1. GitHub Marketplace restricts the use of third-party actions to only public repositories.
  2. GitHub Marketplace serves only as a billing dashboard for tracking paid actions.
  3. GitHub Marketplace provides a centralized location to discover, share, and publish reusable GitHub Actions workflows created by the community or vendors.
  4. GitHub Marketplace allows a user to deploy GitHub Actions workflows to any repository automatically without requiring permissions.

Question 15

How should you print a debug message in your workflow?

  1. echo "::debug::Set variable myVariable to true"
  2. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
  3. echo "::add-mask::Set variable myVariable to true"
  4. echo "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT