Free GH-200 Sample Questions — GitHub Actions

Free GH-200 sample questions for the GitHub Actions exam. No account required: study at your own pace.

Want an interactive quiz? Take the full GH-200 practice test

Looking for more? Click here to get the full PDF with 83+ practice questions for $10 for offline study and deeper preparation.

Question 1

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Each correct answer presents a complete solution. Choose two.)

  • A. default branch
  • B. commit SHA
  • C. repo name
  • D. tag
  • E. organization name
Show Answer
Correct Answer:
  • B. commit SHA
  • D. tag
Question 2

Which action type should be used to bundle a series of run steps into a reusable custom action?

  • A. Composite action
  • B. Bash script action
  • C. Docker container action
  • D. JavaScript action
Show Answer
Correct Answer:
A. Composite action
Question 3

How should you print a debug message in your workflow?

  • A. echo "::debug::Set variable myVariable to true"
  • B. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
  • C. echo "::add-mask::Set variable myVariable to true"
  • D. echo "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT
Show Answer
Correct Answer:
A. echo "::debug::Set variable myVariable to true"
Question 4

What are the mandatory requirements for publishing GitHub Actions to the GitHub Marketplace? (Each correct answer presents part of the solution. Choose two.)

  • A. The action can be either in a public or private repository
  • B. The action’s metadata file must be in the root directory of the repository
  • C. The action’s name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action
  • D. The name should match with one of the existing GitHub Marketplace categories
  • E. Each repository can contain a collection of actions as long as they are under the same Marketplace category
Show Answer
Correct Answer:
  • B. The action’s metadata file must be in the root directory of the repository
  • C. The action’s name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action
Question 5

A single secret must be accessed by workflows in specific repositories. What is the best way to create the secret?

  • A. Create an environment secret at the organization level and leverage that environment in each of the specified repositories
  • B. Create an organization secret, specify Selected repositories as the Repository access, and select the required repositories
  • C. Create the secret in one of the repositories, check the Share secret option, and select the required repositories
  • D. Store the secret in a supported external key vault. Configure OpenID Connect (OIDC) to allow access to the external vault and link the secret from the external key vault in each of the specific repositories
Show Answer
Correct Answer:
B. Create an organization secret, specify Selected repositories as the Repository access, and select the required repositories
Question 6

Which statement is true regarding the ability to delete a workflow run?

  • A. Admin access is required to delete a workflow run
  • B. Pending workflow runs may be deleted
  • C. Completed workflow runs may be deleted
  • D. Workflow runs must be older than 30 days to be deleted
Show Answer
Correct Answer:
C. Completed workflow runs may be deleted
Question 7

Which files are required for a Docker container action in addition to the source code? (Each correct answer presents a partial solution. Choose two.)

  • A. action.yml
  • B. Actionfile
  • C. metadata.yml
  • D. Dockerfile
Show Answer
Correct Answer:
C. metadata.yml
Question 8

When creating and managing custom actions in an enterprise setting, which of the following is considered a best practice?

  • A. creating a separate repository for each action so that the version can be managed independently
  • B. creating a separate branch in application repositories that only contains the actions
  • C. creating a single repository for all custom actions so that the versions for each action are all the same
  • D. including custom actions that other teams need to reference in the same repository as application code
Show Answer
Correct Answer:
C. creating a single repository for all custom actions so that the versions for each action are all the same
Question 9

Which of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?

  • A. run: echo "::set-env name=FOO::bar"
  • B. run: echo "FOO=bar" >> $GITHUB_ENV
  • C. run: echo ${{ $FOO=bar }}
  • D. run: export FOO=bar
Show Answer
Correct Answer:
B. run: echo "FOO=bar" >> $GITHUB_ENV
Question 10

What can be used to set a failed status of an action from its code?

  • A. JavaScript dist/ folder
  • B. composite run step
  • C. output variable
  • D. a non-zero exit code
  • E. Dockerfile CMD
  • F. @actions/github toolkit
Show Answer
Correct Answer:
D. a non-zero exit code
Question 11

Which of the following is a valid reusable workflow reference?

  • A. uses: octo-org/another-repo/workflow.yml@v1
  • B. uses: octo-org/another-repo/.github/workflows/workflow.yml@v1
  • C. uses: another-repo/.github/workflows/workflow.yml@v1
  • D. uses: another-repo/workflow.yml@v1
Show Answer
Correct Answer:
B. uses: octo-org/another-repo/.github/workflows/workflow.yml@v1
Question 12

Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?

  • A. ${{needs.job1.outputs.output1}}
  • B. ${{needs.job1.output1}}
  • C. ${{depends.job1.output1}}
  • D. ${{job1.outputs.output1}}
Show Answer
Correct Answer:
A. ${{needs.job1.outputs.output1}}
Question 13

You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?

  • A. workflow_run
  • B. deployment
  • C. check_suite
  • D. repository_dispatch
Show Answer
Correct Answer:
D. repository_dispatch
Question 14

By default, which workflows can use an action stored in internal repository? (Each answer presents a complete solution. Choose two.)

  • A. selected public repositories outside of the enterprise
  • B. internal repositories owned by the same organization as the enterprise
  • C. public repositories owned by the same organization as the enterprise
  • D. private repositories owned by an organization of the enterprise
Show Answer
Correct Answer:
C. public repositories owned by the same organization as the enterprise
Question 15

What are two reasons to keep an action in its own repository instead of bundling it with other application code? (Each correct answer presents a complete solution. Choose two.)

  • A. It makes the action.yml file optional
  • B. It makes it easier for the GitHub community to discover the action
  • C. It widens the scope of the code base for developers fixing issues and extending the action
  • D. It decouples the action’s versioning from the versioning of other application code
  • E. It allows sharing workflow secrets with other users
Show Answer
Correct Answer:
  • B. It makes it easier for the GitHub community to discover the action
  • D. It decouples the action’s versioning from the versioning of other application code
Question 16

Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. In which scenarios would temporarily disabling a workflow be most useful? (Each correct answer presents a complete solution. Choose two.)

  • A. runner needs to have diagnostic logging enabled
  • B. workflow error produces too many, or wrong, requests, impacting external services negatively
  • C. workflow is configured to run on self-hosted runners
  • D. workflow sends requests to a service that is down
  • E. workflow needs to be changed from running on a schedule to a manual trigger
Show Answer
Correct Answer:
  • B. workflow error produces too many, or wrong, requests, impacting external services negatively
  • D. workflow sends requests to a service that is down
Question 17

Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Each correct answer presents a complete solution. Choose three.)

  • A. Actions created by GitHub are automatically available and cannot be disabled
  • B. Third-party actions can be used on GitHub Enterprise Server by configuring GitHub Connect
  • C. Most GitHub-authored actions are automatically bundled for use on GitHub Enterprise Server
  • D. Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection
  • E. Actions must be defined in the .github repository
  • F. Third-party actions can be manually synchronized for use on GitHub Enterprise Server
Show Answer
Correct Answer:
C. Most GitHub-authored actions are automatically bundled for use on GitHub Enterprise Server
Question 18

GitHub-hosted runners support which capabilities? (Each correct answer presents a complete solution. Choose two.)

  • A. support for Linux, Windows, and macOS
  • B. support for a variety of Linux variations including CentOS, Fedora, and Debian
  • C. requiring a payment mechanism (e.g., credit card) to use for private repositories
  • D. automatic file-system caching between workflow runs
  • E. automatic patching of both the runner and the underlying OS
Show Answer
Correct Answer:
  • A. support for Linux, Windows, and macOS
  • C. requiring a payment mechanism (e.g., credit card) to use for private repositories
Question 19

As a developer, how can you identify a composite action on GitHub?

  • A. The action’s repository name includes the keyword “composite.”
  • B. The action’s repository includes an init.sh file in the root directory
  • C. The action’s repository includes Dockerfile and package.json files
  • D. The action.yml metadata file has the runs.using value set to composite
Show Answer
Correct Answer:
D. The action.yml metadata file has the runs.using value set to composite
Question 20

Which step is using the dbserver environment variable correctly?

  • A. steps: - name: Hello world run: echo $dbserver variables: dbserver: orgserver1
  • B. steps: - name: Hello world run: echo $dbserver env: - name: dbserver value: orgserver1
  • C. steps: - name: Hello world run: echo $dbserver environment: dbserver: orgserver1
  • D. steps: - name: Hello world run: echo $dbserver env: dbserver: orgserver1
Show Answer
Correct Answer:
D. steps: - name: Hello world run: echo $dbserver env: dbserver: orgserver1

Aced these? Get the Full Exam

Download the complete GH-200 study bundle with 83+ questions in a single printable PDF.