Welcome to awslagi.com – Sharing AWS, Anthropic, Google Cloud, Microsoft Azure IT Exams. It's free for all!

GitHub Actions

Master automation with GitHub Actions.

4.8★★★★★(338 ratings)
20,378 studentsIntermediate
Validates your ability to design, secure, and optimize workflows across repositories and organizations. You’ll build CI/CD pipelines, reusable actions, and event‑driven automation.

What you'll learn

  • Teaches how to create complex workflows triggered by events, manage secrets, and secure runner environments. You’ll also learn to share and version workflows at scale.

GH-200

Lectures1
Questions42
Duration30 week
Students20,378

$20.00

Full Free Question Bank (42 Questions)

GitHub Actions (GH-200) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Question #1Part 1

How should you print a debug message in your workflow?

Aecho "::debug::Set variable myVariable to true"
Becho "Set variable MyVariable to true" >> $DEBUG_MESSAGE
Cecho "::add-mask::Set variable myVariable to true"
Decho "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT
Question #2Part 1Select 2

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

Aselected public repositories outside of the enterprise
Binternal repositories owned by the same organization as the enterprise
Cpublic repositories owned by the same organization as the enterprise
Dprivate repositories owned by an organization of the enterprise
Question #3Part 1

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

ABash script action
BComposite action
CJavaScript action
DDocker container action
Question #4Part 1Select 2

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

Adefault branch
Bcommit SHA
Crepo name
Dtag
Eorganization name
Question #5Part 1

As a developer, you are designing a workflow and need to communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks. Which of the following options should you use?

Acomposite run step
Benable debug logging
Cself-hosted runners
Denvironment variables
Eworkflow commands
Question #6Part 1

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

AGITHUB_REF
BGITHUB_BRANCH
CENV_BRANCH
DGITHUB_TAG
Question #7Part 1

What is the most suitable action type for a custom action written in TypeScript?

ADocker container action
BBash script action
Ccomposite run step
DJavaScript action
Question #8Part 1

What is a valid scenario regarding environment secrets?

Aconfiguring environment secrets for connecting to GitHub Enterprise Server
Bconfiguring environment secrets to automatically pull from Azure Key Vault
Censuring a job cannot access environment secrets until approval is obtained from a required reviewer
Densuring only a specific step can access an environment secret
Question #9Part 1

When should you use the GITHUB_TOKEN in a workflow?

Awhen you want to make authenticated calls to the GitHub API
Bwhen you want to connect to the runner via SSH
Cwhen you want to access repository-level secrets
Dwhen you want to call an action from the marketplace
Question #10Part 1Select 2

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

Aon: [push, pull_request]
Bon:
Con:
Don: [push, commit]
Eon:
Question #11Part 1

You are a DevOps engineer working on custom Actions development. You need to handle the 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) { > }

Acore.setException(error.message);
Baction.setError(error.message);
Ccore.setFailed(error.message);
Dcore.action.setException(error.message);
Question #12Part 1Select 2

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

AIt makes the action.yml file optional.
BIt makes it easier for the GitHub community to discover the action.
CIt widens the scope of the code base for developers fixing issues and extending the action.
DIt decouples the action’s versioning from the versioning of other application code.
EIt allows sharing workflow secrets with other users.
Question #13Part 1

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?

APOST /repos/:owner/:repo/actions/runs/:run_id/logs
BGET /repos/:owner/:repo/actions/runs/:run_id/logs
CPOST /repos/:owner/:repo/actions/runs/:run_id
DGET /repos/:owner/:repo/actions/artifacts/logs
Question #14Part 1Select 2

Which workflow commands send information from the runner? (Each correct answer presents a complete solution. Choose two.)

Areading from environment variables
Bsetting a debug message
Cpopulating variables in a Dockerfile
Dsetting output parameters
Question #15Part 1

As a developer, you are authoring a workflow that will deploy to both DevCloud and TestCloud resources. Each cloud resource is accessed with a different deployment key. Which approach best allows you to use the same reusable workflow in separate jobs to target the different cloud resources?

APopulate a DEPLOY_KEY repository secret with a JSON object containing DevCloud and TestCloud properties. Then specify DEPLOY_KEY.DevCloud in the secrets sections of the reusable workflow.
BUse a marketplace action to conditionally parse the DEPLOY_KEY repository secret based on the cloud resource name.
CStore the different keys in a DEPLOY_KEY environment secret in the DevCloud and TestCloud environments. Specify DEPLOY_KEY in the secrets section of the reusable workflow.
DCreate repository secrets named DevCloud.DEPLOY_KEY and TestCloud.DEPLOY_KEY so that the reusable workflow parses the secrets by resource name.
Question #16Part 1

As a developer, you need to leverage Redis in your workflow. What is the best way to use Redis on a self-hosted Linux runner without affecting future workflow runs?

AInstall Redis on the hosted runner image and place it in a runner group. Specify label: in your job to target the runner group.
BSet up Redis on a separate machine and reference that instance from your job.
CSpecify container: and services: in your job definition to leverage a Redis service container.
DAdd a run step to your workflow, which dynamically installs and configures Redis as part of your job.
Question #17Part 1Select 2

You are reaching your organization’s storage limit for GitHub artifacts and packages. What should you do to prevent the storage limit from being reached? (Each correct answer presents a complete solution. Choose two.)

AUse self-hosted runners for all workflow runs.
BDelete artifacts from the repositories manually.
CConfigure the artifact and log retention period.
DDisable branch protections in the repository.
EConfigure the repo to use Git Large File Storage.
Question #18Part 1

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

Asteps:
Bsteps:
Csteps:
Dsteps:
Question #19Part 1Select 2

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

Asupport for Linux, Windows, and macOS
Bsupport for a variety of Linux variations including CentOS, Fedora, and Debian
Crequiring a payment mechanism (e.g., credit card) to use for private repositories
Dautomatic file-system caching between workflow runs
Eautomatic patching of both the runner and the underlying OS
Question #20Part 1Select 2

You installed specific software on a Linux self-hosted runner. You have users with workflows that need to be able to select the runner based on the identified custom software. Which steps should you perform to prepare the runner and your users to run these workflows? (Each correct answer presents part of the solution. Choose two.)

AConfigure the webhook and network to enable GitHub to trigger workflow.
BCreate the group custom-software-on-linux and move the runner into the group.
CInform users to identify the runner with the labels custom-software and linux.
DAdd the label linux to the runner.
EInform users to identify the runner based on the group.
Question #21Part 1

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

A30 days
B60 days
C14 days
D7 days
Question #22Part 1

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?

Aruns:
Bruns:
Cruns:
Druns:
Question #23Part 1

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

Avia a repository owned by a third party
Bvia repositories owned by the organization
Cvia the GitHub Marketplace
Dvia the .github repository owned by the organization
Question #24Part 1

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

Aworkflow_run
Bdeployment
Ccheck_suite
Drepository_dispatch
Question #25Part 1

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

A${{var.GITHUB_RUN_NUMBER}}
B${{env.GITHUB_RUN_NUMBER}}
C$GITHUB_RUN_NUMBER
D${{GITHUB_RUN_NUMBER}}
E$github.run_number
Question #26Part 1

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

AThe action’s repository includes a js.yml file in the .github/workflows directory.
BThe action’s repository name includes the keyword “JavaScript.”
CThe action.yml metadata file has the runs.using value set to node16.
DThe action.yml metadata file references a package.json file.
Question #27Part 1

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

ACreate an environment secret at the organization level and leverage that environment in each of the specified repositories.
BCreate an organization secret, specify Selected repositories as the Repository access, and select the required repositories.
CCreate the secret in one of the repositories, check the Share secret option, and select the required repositories.
DStore 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.
Question #28Part 1Select 3

In which locations can actions be referenced by workflows? (Each correct answer presents a complete solution. Choose three.)

Aan .action extension file in the repository
Ba published Docker container image on Docker Hub
Ca public NPM registry
Dthe runs-on: keyword of a workflow file
Ethe repository’s Secrets settings page
Question #29Part 1Select 2

How can a workflow deploy mitigate the risk of multiple workflow runs that are deploying to a single cloud environment simultaneously? (Each correct answer presents part of the solution. Choose two.)

AReference the mutex in the task performing the deployment.
BSet the concurrency in the deploymentjob to 1.
CSpecify a target environment in the deploymentjob.
DSpecify a concurrency scope in the workflow.
EConfigure the mutex setting in the environment.
Question #30Part 1Select 2

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? (Each correct answer presents part of the solution. Choose two.)

Apath: the file path on the runner to cache or restore
Bdependency: the name and version of a package to cache or restore
Ckey: the key created when saving a cache and the key used to search for a cache
Drestore-keys: the copy action key used with cache parameter to cache the data
Ecache-hit: the copy action key used with restore parameter to restore the data from the cache
Question #31Part 1Select 2

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

AIt generates auto completion when using the action in a workflow.
BIt shares the description of the action to the users.
CIt provides an example of the action.
DIt creates a readme.md for the consuming workflow.
Question #32Part 1

Scheduled workflows run on the:

Aspecified commit and branch from the workflow YAML file.
Blatest commit from the branch named schedule.
Clatest commit and branch on which the workflow was triggered.
Dlatest commit from the branch named main.
Elatest commit on the default or base branch.
Question #33Part 1

Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?

AGITHUB_ACTOR
BGITHUB USER
CENV_ACTOR
DGITHUB_WORKFLOW_ACTOR
Question #34Part 1

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

AThe action’s repository name includes the keyword “composite.”
BThe action’s repository includes an init.sh file in the root directory.
CThe action’s repository includes Dockerfile and package.json files.
DThe action.yml metadata file has the runs.using value set to composite.
Question #35Part 1Select 2

A workflow that had been working now stalls in a waiting state until failing. The workflow file process-ml.yaml has not changed and contains jobs specifying runs-on: [gpu ]. Which of the following steps would troubleshoot the issue? (Each answer presents a complete solution. Choose two.)

AReview the contents of the Runner_*.log files in the _diag folder.
BIncrease the usage limits for the GitHub-hosted runners.
CCheck the “Set up job” step for the logs of the last successful run to determine the runner.
DUpdate the org settings to enable GPU-based GitHub-hosted runners.
ERotate the GITHUB_TOKEN secret for the appropriate runners.
Question #36Part 1Select 3

Custom environment variables can be defined at multiple levels within a workflow file including: (Each answer presents a complete solution. Choose three.)

Atop level.
Bstep level.
Cdefault level.
Drunner level.
Ejob level.
Question #37Part 1Select 2

As a developer, you are configuring GitHub Actions to deploy VMs to production. A member of the VMOps team must provide approval before the deployment occurs. Which of the following steps should you take? (Each correct answer presents part of the solution. Choose two.)

ANavigate to the organization settings and create a Production environment with the VMOps team as a required reviewer.
BSpecify the environment named Production in the workflow jobs that deploy to the VMs.
CNavigate to the repository settings and create a Production environment with the VMOps team as a required reviewer.
DAdd the VMs to the environment.
ESpecify the VMOps team as the owner of the environment.
Question #38Part 1

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

AJavaScript dist/ folder
Bcomposite run step
Coutput variable
Da non-zero exit code
EDockerfile CMD
Question #39Part 1Select 3

Your organization needs to simplify reusing and maintaining automation in your GitHub Enterprise Cloud. Which components can be directly reused across all repositories in an organization? (Each correct answer presents a complete solution. Choose three.)

Aactions stored in an organizational partition in the GitHub Marketplace
Bcustom Docker actions stored in GitHub Container Registry
Cself-hosted runners
Dencrypted secrets
Eworkflow templates
Question #40Part 1

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?

Ajobs:
Bjobs:
Cjobs:
Djobs:
Question #41Part 1

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

ATriage
BAdmin
CMaintain
DWrite
ERead
Question #42Part 1Select 2

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? (Each correct answer presents a complete solution. Choose two.)

AStore 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.
BUse 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.
CStore 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.
DStore 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.
EStore the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!