Weekend Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: fifty75ct

GH-200 GitHub Actions Exam Questions and Answers

Questions 4

As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action. Which input parameters are required for this action? (Choose two.)

Options:

A.

dependency: the name and version of a package to cache or restore

B.

key: the key created when saving a cache and the key used to search for a cache

C.

cache-hit: the copy action key used with restore parameter to restore the data from the cache

D.

path: the file path on the runner to cache or restore

E.

ref: the ref name of the branch to access and restore a cache created

F.

restore-keys: the copy action key used with cache parameter to cache the data

Buy Now
Questions 5

Which scopes are available to define custom environment variables within a workflow file? (Choose three.)

Options:

A.

the entire workflow, by using env at the top level of the workflow file

B.

all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file

C.

the entire stage, by using env at the top of the defined build stage

D.

within the run attribute of a job step

E.

the contents of a job within a workflow, by using jobs. < job_id > .env

F.

a specific step within a job, by using jobs. < job_id > .steps[*].env

Buy Now
Questions 6

Which default environment variable specifies the branch or tag that triggered a workflow?

Options:

A.

GITHUB_TAG

B.

GITHUB_REF

C.

ENV_BRANCH

D.

GITHUB_BRANCH

Buy Now
Questions 7

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

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 8

How should you print a debug message in your workflow?

Options:

A.

echo " Set variable MyVariable to true " > > $DEBUG_MESSAGE

B.

echo " ::debug::Set variable MyVariable to true "

C.

echo " ::add-mask::Set variable MyVariable to true "

D.

echo " debug_message=Set variable MyVariable to true " > > $GITHUB_OUTPUT

Buy Now
Questions 9

As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?

Options:

A.

jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ strategy.node-ver }}

B.

jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}

C.

jobs:build-app:matrix-strategy:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix-strategy.node-ver }}

D.

jobs:build-app:matrix:strategy:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}

Buy Now
Questions 10

As a developer, what options should you recommend to implement standards for automation reuse? (Choose two.)

Options:

A.

Create workflow templates and store them in the organization ' s .github repository.

B.

Create reusable actions and workflows that can be called from other workflows.

C.

Create a marketplace partition to publish reusable automation for the company.

D.

Store shared corporate actions in subfolders in a defined and documented internally accessible repository.

Buy Now
Questions 11

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

Options:

A.

Completed workflow runs may be deleted.

B.

Pending workflow runs may be deleted.

C.

Workflow runs must be older than 30 days to be deleted.

D.

Admin access is required to delete a workflow run.

Buy Now
Questions 12

You are a DevOps engineer working on custom Actions development. You need to handle errors or exceptions as part of the JavaScript-based action code. What should be added to the following code block to handle errors?

const core = require( ' @actions/core ' );

try {

// action code

} catch (error) {

// insert snippet here

}

Options:

A.

core.setException(error.message);

B.

core.action.setException(error.message);

C.

core.setFailed(error.message);

D.

action.setError(error.message);

Buy Now
Questions 13

As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?

Options:

A.

There is a different value specified at the rego level.

B.

There is a different value specified at the workflow level.

C.

The Codespace secret doesn ' t match the expected value.

D.

The Encrypt Secret setting was not configured for the secret.

E.

There is a different value specified at the enterprise level.

Buy Now
Questions 14

Which default GitHub environment variable indicates the owner and repository name?

Options:

A.

REPOSITORY NAME

B.

GITHUB REPOSITORY

C.

ENV REPOSITORY

D.

GITHUB WORKFLOW REPO

Buy Now
Questions 15

Which of the following is the most common way to target a specific major release version?

Options:

A.

steps:uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

B.

steps:uses: actions/checkout@U1673995124

C.

steps:uses: actions/checkout@v3

D.

steps:uses: actions/checkout

Buy Now
Questions 16

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

Options:

A.

@actions/github toolkit

B.

JavaScript dist/ folder

C.

Dockerfile CMD

D.

a non-zero exit code

E.

output variable

F.

composite run step

Buy Now
Questions 17

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

Options:

A.

check_suite

B.

workflow_run

C.

deployment

D.

repository_dispatch

Buy Now
Questions 18

Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?

Options:

A.

Create a list of the actions that are restricted from being used as an enterprise policy. Every other action can be run.

B.

It is not possible; if an action is in the marketplace, its use cannot be restricted.

C.

Create a list that is maintained as a . yml file in a . github repository specified in the enterprise. Only these actions can be run.

D.

Create a list of the actions that are allowed to run as an enterprise policy. Only these actions can be run.

Buy Now
Questions 19

Which command can you include in your workflow file to set the output parameter for an action?

Options:

A.

echo " action_color=purple " > > $GITHUB_OUTPUT

B.

echo " action_color=purple " > > $GITHUB_ENV

C.

echo " ::add-mask::$ACTION_COLOR "

D.

echo " ::debug::action_color=purple "

Buy Now
Questions 20

Which statement accurately describes using labels to route GitHub Actions workflows to runners?

Options:

A.

A user can assign multiple labels to a self-hosted runner and use the labels in a runs-on to target only runners that match all the specified labels.

B.

Labels apply only to GitHub-hosted runners and are ignored by self-hosted runners.

C.

GitHub Actions automatically assigns the runner’s IP address as a label, and the label must be used in a runs-on.

D.

To target a specific runner, the runs-on must match the runner’s hostname rather than its labels.

Buy Now
Questions 21

Which statement is true about using default environment variables?

Options:

A.

The environment variables can be read in workflows using the ENV: variable_name syntax.

B.

The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows

C.

The environment variables can be set in the defaults: sections of the workflow

D.

The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.

Buy Now
Questions 22

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

Options:

A.

Composite action

B.

Bash script action

C.

Docker container action

D.

JavaScript action

Buy Now
Questions 23

How many jobs will result from the following matrix configuration?

Options:

A.

3 jobs

B.

4 jobs

C.

5 jobs

D.

6 jobs

Buy Now
Questions 24

As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)

Options:

A.

Use the actions/setup-docker action

B.

Authenticate to the GitHub Container Registry.

C.

Build the container image.

D.

Push the image to the GitHub Container Registry

E.

Pull the image from the GitHub Container Registry.

Buy Now
Questions 25

What are the two ways to pass data between jobs? (Choose two.)

Options:

A.

Use the copy action with restore parameter to restore the data from the cache

B.

Use the copy action to save the data that should be passed in the artifacts folder.

C.

Use the copy action with cache parameter to cache the data

D.

Use data storage.

E.

Use job outputs

F.

Use artifact storage.

Buy Now
Questions 26

You are a developer working on developing reusable workflows for your organization. What keyword should be included as part of the reusable workflow event triggers?

Options:

A.

check_run

B.

pull_request

C.

workflow_run

D.

workflow_call

Buy Now
Questions 27

What are the two types of environment protection rules you can configure? (Choose two.)

Options:

A.

required reviewers

B.

branch protections

C.

wait timer

D.

artifact storage

Buy Now
Questions 28

Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Choose three.)

Options:

A.

Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection

B.

Actions created by GitHub are automatically available and cannot be disabled

C.

Most GitHub authored actions are automatically bundled for use on GitHub Enterprise Server

D.

Third party actions can be used on GitHub Enterprise Server by configuring GitHub Connect

E.

Actions must be defined in the .github repository

F.

Third party actions can be manually synchronized for use on GitHub Enterprise Server

Buy Now
Questions 29

What are the two most significant advantages of adding documentation while distributing custom actions? Each correct answer presents a complete solution.

NOTE: Each correct answer is worth one point.

Options:

A.

It creates a readme.md for the consuming workflow.

B.

It shares the description of the action to the users.

C.

It provides an example of the action.

D.

It generates auto completion when using the action in a workflow.

Buy Now
Questions 30

Custom environment variables can be defined at multiple levels within a workflow file, including which three levels?

(Each correct answer presents a complete solution. Choose three.)

Options:

A.

Stage level

B.

Default level

C.

Step level

D.

Runner level

E.

Top level

F.

Job level

Buy Now
Questions 31

You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?

Options:

A.

POST /repos/:owner/:repo/actions/runs/:run_id

B.

GET /repos/:owner/:repo/actions/artifacts/logs

C.

GET /repos/:owner/:repo/actions/runs/:run_id/logs

D.

POST /repos/:owner/:repo/actions/runs/:run_id/logs

Buy Now
Questions 32

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?

Options:

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

Buy Now
Questions 33

While writing a custom action, some behavior within the runner must be changed. Which workflow commands would set an error message in the runner ' s output?

(Each correct answer presents a complete solution. Choose two.)

Options:

A.

echo " ::error message=There was an error:: "

B.

echo " ::error::There was an error "

C.

echo " ::error file=main.py,line=10,col=15::There was an error "

D.

echo " ::error=There was an error:: "

Buy Now
Questions 34

You are a DevOps engineer working on a custom action. You want to conditionally run a script at the start of the action, before the main entrypoint. Which code block should be used to define the metadata file for your custom action?

Options:

A.

runs:using: ' node16 ' start: ' start.js ' start-if: github.event_name == ' push ' main: ' index.js '

B.

runs:using: ' node16 ' pre: ' start.js ' pre-if: github.event_name == ' push ' main: ' index.js '

C.

runs:using: ' node16 ' pre-if: github.event_name == ' push ' then ' start.js ' main: ' index.js '

D.

runs:using: ' node16 ' before: ' start.js ' before-if: github.event_name == ' push ' main: ' index.js '

Buy Now
Questions 35

An organization ' s policies specify that only local actions are allowed. How should actions be distributed for this organization?

Options:

A.

Via the GitHub Marketplace

B.

Via the .github repository owned by the organization

C.

Via a repository owned by a third party

D.

Via repositories owned by the organization

Buy Now
Questions 36

What will the output be for the following event trigger block in a workflow?

Options:

A.

It throws a workflow syntax error, pointing to the types definition in issue_comment event.

B.

It throws a workflow syntax error, pointing to the types definition in issues event.

C.

It runs the workflow when an issue is edited or when an issue comment created.

D.

It runs the workflow when an issue or issue comment in the workflow ' s repository is created or modified.

E.

It runs the workflow when an issue is created or edited, or when an issue or pull request comment is created.

Buy Now
Questions 37

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

Options:

A.

passing the GITHUB_TOKEN secret to an action that requires a token as an input

B.

making an authenticated GitHub API request

C.

checking out source code with the actions/checkout@v3 action

D.

assigning non-default permissions to the GITHUB_TOKEN

Buy Now
Questions 38

What are the most significant advantages of adding documentation while distributing custom actions?

(Each answer presents a complete solution. Choose two.)

Options:

A.

It shares the description of the action with users.

B.

It creates a README.md for the consuming workflow.

C.

It provides an example of the action.

D.

It generates autocomplete when using the action in a workflow.

Buy Now
Questions 39

You need to create a reusable GitHub Actions workflow template named ci.yml. The solution must ensure that ci.yml appears on the New workflow interface of GitHub Actions. Where should you store ci.yml?

Options:

A.

.github/workflows

B.

.github/templates

C.

.github/workflow-templates

D.

the root directory of each repository

Buy Now
Questions 40

As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Choose two.)

Options:

A.

Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.

B.

Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.

C.

Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.

D.

Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.

E.

Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.

Buy Now
Questions 41

As a DevOps engineer, you need to execute a deployment to different environments such as development and testing based on labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in files under the apps folder. Which code block should be used to define the deployment workflow trigger?

Options:

A.

on:

pull_request_review:

types: [labeled]

branches:

- ' releases '

paths:

- ' apps/** '

B.

on:

pull_request:

types: [labeled]

branches:

- ' releases/** '

paths:

- ' apps '

C.

on:

pull_request:

types: [labeled]

branches:

- ' releases '

paths:

- ' apps/** '

D.

on:

pull_request_label:

branches:

- ' releases '

paths:

- ' apps/** '

Buy Now
Exam Code: GH-200
Exam Name: GitHub Actions Exam
Last Update: Oct 5, 2026
Questions: 137
GH-200 pdf

GH-200 PDF

$23.75  $94.99
GH-200 Engine

GH-200 Testing Engine

$27.5  $109.99
GH-200 PDF + Engine

GH-200 PDF + Testing Engine

$36.25  $144.99