Pre-Winter Special Sale - 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: spcl70

Practice Free GH-200 GitHub Actions Exam Exam Questions Answers With Explanation

We at Crack4sure are committed to giving students who are preparing for the Microsoft GH-200 Exam the most current and reliable questions . To help people study, we've made some of our GitHub Actions Exam exam materials available for free to everyone. You can take the Free GH-200 Practice Test as many times as you want. The answers to the practice questions are given, and each answer is explained.

Question # 6

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:

dbserver: orgserver1

C.

steps:

- name: Hello world

run: echo $dbserver

env:

- name: dbserver

value: orgserver1

D.

steps:

- name: Hello world

run: echo $dbserver

environment:

dbserver: orgserver1

Question # 7

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?

A.

.github/workflows

B.

.github/templates

C.

.github/workflow-templates

D.

the root directory of each repository

Question # 8

As a developer, you need to integrate a GitHub Actions workflow with a third-party code quality provider that uses the Checks API. How should you trigger a follow-up workflow?

A.

Add the workflow_run webhook event as a trigger for the workflow for the code quality integration name

B.

Add the check_run webhook event as a trigger for the workflow when the code quality integration is completed

C.

Add the pull_request webhook event as a trigger for the workflow when the code quality integration is synchronized

D.

Add the deployment webhook event as a trigger for the workflow when the code quality integration is completed

Question # 9

You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?

A.

self-hosted: [windows-x64]

B.

runs-on: [self-hosted, windows, x64]

C.

runs-on: windows-latest

D.

self-hosted: [windows, x64]

Question # 10

What is the simplest action type to run a shell script?

A.

Docker container action

B.

Composite action

C.

Bash script action

D.

JavaScript action

Question # 11

As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?

As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?

A.

core.info( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

B.

core.notice( ' Something went wrong, but it\’s not bad enough to fail the build. ' )

C.

core.warning( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

D.

core.warn( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

Question # 12

A development team has been using a Powershell script to compile and package their solution using existing tools on a Linux VM, which has been configured as a self-hosted runner. They would like to use the script as-is in an automated workflow. Which of the following should they do to invoke their script within a workflow step?

A.

Configure a self-hosted runner on Windows with the requested tools.

B.

Use the YAML powershell: step.

C.

Run the pwsh2bash command to convert the script so it can be run on Linux.

D.

Use the YAML shell: pwsh in a run step.

E.

Use the actions/run-powershell action to invoke the script.

Question # 13

What is the proper syntax to reference the system-provided run number variable?

A.

$GITHUB_RUN_NUMBER

B.

${{ env.GITHUB_RUN_NUMBER }}

C.

${{ var.GITHUB_RUN_NUMBER }}

D.

$github.run_number

E.

${{ GITHUB_RUN_NUMBER }}

Question # 14

You need to use a specific version of an action. How should you use v1 of an actions/javascript-action repository in your workflow?

A.

steps:uses: actions/javascript-action/v1

B.

steps:uses: actions/javascript-actionversion: v1

C.

steps:uses: actions/javascript-action-v1

D.

steps:uses: actions/javascript-action@v1

Question # 15

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?

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 }}

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? (Choose two.)

A.

A workflow sends requests to a service that is down.

B.

A workflow error produces too many, or wrong, requests, impacting external services negatively.

C.

A workflow is configured to run on self-hosted runners

D.

A workflow needs to be changed from running on a schedule to a manual trigger

E.

A runner needs to have diagnostic logging enabled.

Question # 17

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

A.

The action ' s repository includes @actions/core in the root directory.

B.

The action ' s repository name includes the keyword " Docker. "

C.

The action.yml metadata file references a Dockerfile file.

D.

The action.yml metadata file has the runs.using value set to Docker.

Question # 18

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

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

Question # 19

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.

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.

Question # 20

When reviewing an action for use, what file defines its available inputs and outputs?

A.

inputs.yml

B.

config.json

C.

defaults.json

D.

workflow.yml

E.

action.yml

Question # 21

Without the need to use additional infrastructure, what is the simplest and most maintainable method for configuring a workflow job to provide access to an empty PostgreSQL database?

A.

Use service containers with a Postgres database from Docker hub.

B.

Run the actions/postgres action in a parallel job.

C.

It is currently impossible to access the database with GitHub Actions.

D.

Dynamically provision and deprovision an environment.

Question # 22

How should you print a debug message in your workflow?

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

Question # 23

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?

A.

runs-on: [self-hosted, linux-xlarge]

B.

runs-on: - self-hosted - ubuntu-latest

C.

runs-on: [self-hosted, runner1]

D.

runs-on: self-hosted

Question # 24

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question # 25

As a developer, you need to add the correct syntax to allow the following workflow file to be triggered by multiple types of events.

Which two code blocks should you add starting at line 5? Each correct answer presents a complete solution.

NOTE: Each correct answer is worth one point.

4 name: Node CI/CD

5

6

7

8 jobs:

9 build:

10 runs-on:

11 steps:

12 - uses: actions/checkout@v2

13 - uses: actions/setup-node@v1

14 with:

15 node-version: 12

16 - run: npm ci

17 - run: npm test

18

A.

on:env:- ' prod ' - ' qa ' - ' test '

B.

on: [push, commit]

C.

on: [push, pull_request]

D.

on:branches:- ' main ' - ' dev '

E.

on:push:branches:- mainrelease:types:- created

F.

on:schedule:- cron: ' */15 * * * * ' initiate:- ' main '

Question # 26

You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you to implement the conditional execution of the job?

A.

jobs:deploy:if: github.ref_name == ' feature-branch ' runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3

B.

jobs:deploy:if: github.ref.name == ' feature-branch ' runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3

C.

jobs:deploy:if: github.branch_name == ' feature-branch ' runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3

D.

jobs:deploy:if: github.branch.name == ' feature-branch ' runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3

Question # 27

Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?

A.

Write

B.

Triage

C.

Maintain

D.

Read

E.

Admin

Question # 28

Which workflow event is used to manually trigger a workflow run?

A.

create

B.

workflow_dispatch

C.

workflow_run

D.

status

Question # 29

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

A.

GITHUB_TAG

B.

GITHUB_REF

C.

ENV_BRANCH

D.

GITHUB_BRANCH

Question # 30

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

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

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.

Question # 31

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

}

A.

core.setException(error.message);

B.

core.action.setException(error.message);

C.

core.setFailed(error.message);

D.

action.setError(error.message);

Question # 32

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

A.

@actions/github toolkit

B.

JavaScript dist/ folder

C.

Dockerfile CMD

D.

a non-zero exit code

E.

output variable

F.

composite run step

Question # 33

As a developer, you have configured an IP allow list on a GitHub organization. Which effects does the IP allow list have on GitHub Actions?

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

A.

You must allow GitHub Actions ' IP address ranges in order to use Marketplace actions.

B.

You can use standard GitHub-hosted runners since their IP addresses are automatically allowed.

C.

You can use GitHub-hosted larger runners since they can be configured with static IP addresses.

D.

You can use self-hosted runners with known IP addresses.

Question # 34

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.)

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:: "

Question # 35

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

A.

GitHub Marketplace restricts the use of third-party actions to only public repositories.

B.

GitHub Marketplace serves only as a billing dashboard for tracking paid actions.

C.

GitHub Marketplace provides a centralized location to discover, share, and publish reusable GitHub Actions workflows created by the community or vendors.

D.

GitHub Marketplace allows a user to deploy GitHub Actions workflows to any repository automatically without requiring permissions.

Question # 36

Which statement is true about using default environment variables?

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.

Question # 37

While awaiting approval, how many days can a workflow be in the “Waiting” state before it automatically fails?

A.

7 days

B.

14 days

C.

30 days

D.

60 days

Question # 38

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

Question # 39

What metadata file in a custom action defines the main entry point?

A.

action.js

B.

index.js

C.

action.yml

D.

main.yml

Question # 40

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?

A.

check_run

B.

workflow_run

C.

workflow_call

D.

pull_request

Question # 41

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?

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 '

GH-200 PDF

$42

$139.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

GH-200 PDF + Testing Engine

$57

$189.99

3 Months Free Update

  • Exam Name: GitHub Actions Exam
  • Last Update: Oct 6, 2026
  • Questions and Answers: 137
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

GH-200 Engine

$48

$159.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included