github GITHUB ACTIONS Exam Questions

Questions for the GITHUB ACTIONS were updated on : Nov 21 ,2025

Page 1 out of 5. Viewing questions 1-15 out of 72

Question 1

As a developer, you need to create a custom action written in Python. Which action type should you
choose?
As a developer, you need to create a custom action written in Python. Which action type should you
choose?

  • A. JavaScript action
  • B. composite run step
  • C. Python action
  • D. Docker container action
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
A Docker container action is ideal for custom actions that require specific environments or
dependencies, such as Python. By creating a Docker container, you can define the environment with
the necessary Python version and dependencies, and your Python code can run inside that container.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

As a developer, your self-hosted runner sometimes looses connection while running jobs. How
should you troubleshoot the issue affecting your self-hosted runner?

  • A. Set the DEBUG environment variable to true before starting the self-hosted runner to produce more verbose console output.
  • B. Locate the self-hosted runner in your repository's settings page and download its log archive.
  • C. Access the self-hosted runner's installation directory and look for log files in the _diag folder.
  • D. Start the self-hosted runner with the --debug flag to produce more verbose console output.
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
When troubleshooting a self-hosted runner, you can access the _diag folder located in the self-
hosted runner's installation directory. This folder contains diagnostic logs that can help you identify
the root cause of issues, such as connection problems.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

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.')
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
The core.warning() function from the @actions/core package is used to create a warning message in
the workflow logs. This is an annotation type that informs users about issues that don't require
failing the build but still need attention.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

Which files are required for a Docker container action in addition to the source code? (Choose two.)

  • A. Dockerfile
  • B. Actionfile
  • C. metadata.yml
  • D. action.yml
Answer:

A, D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Dockerfile: The Dockerfile is required for Docker container actions. It defines the environment for the
action, specifying the base image, dependencies, and any commands to set up the action’s runtime
inside the container.
action.yml: The action.yml file is required for all GitHub Actions, including Docker container actions.
It contains metadata about the action, including the inputs, outputs, and the runtime environment
(which in this case is Docker, defined under runs.using).

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

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.
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
In a Docker container action, the action.yml file includes the runs.using field, which is set to docker to
specify that the action runs inside a Docker container. This is the key indicator that the action is a
Docker container action.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Which run: command will set a step's output?

  • A. run: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT
  • B. run: export MY_OUTPUT=foo
  • C. run: echo ${{ $GITHUB_OUTPUT=foo }}
  • D. run: echo "::set-env name=MY OUTPUT::foo"
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
The $GITHUB_OUTPUT file is used to pass data from one step to another in GitHub Actions. The echo
command appends the key-value pair to this file, which sets the output variable (MY_OUTPUT) for
the current step.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

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

  • A. Delete artifacts from the repositories manually
  • B. Disable branch protections in the repository.
  • C. Use self-hosted runners for all workflow runs.
  • D. Configure the artifact and log retention period.
  • E. Configure the repo to use Git Large File Storage.
Answer:

A, D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
Deleting artifacts from repositories manually will free up storage space. Artifacts are typically stored
for a limited time by default, but manual cleanup can help manage space.
Configuring the artifact and log retention period allows you to control how long artifacts and logs are
retained in your repository. By shortening the retention period, you can prevent unnecessary
accumulation of data and manage storage more effectively.

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8

What is the right method to ensure users approve a workflow before the next step proceeds?

  • A. creating a branch protection rule and only allow certain users access
  • B. granting users workflow approval permissions
  • C. adding users as required reviewers for an environment
  • D. granting users repository approval permissions
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
GitHub Actions allows you to configure environment protection rules, where you can require specific
users or teams to approve the deployment before the workflow proceeds to the next step. This
ensures that the required reviewers approve the workflow before any sensitive actions (such as
deployment) occur.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

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?

  • 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.
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
GitHub secrets are defined at different levels: organization, repository, and sometimes at the
workflow level. If a secret is defined at both the organization level and the repository level, the
repository-level secret will take precedence. So, if the value of the secret differs between these
levels, the workflow will use the value from the repository level instead of the organization level.

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 10

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

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
A composite action allows you to bundle multiple steps into a single reusable action within a
workflow. It is composed of multiple run steps or other actions and can be reused across workflows,
making it the perfect choice for bundling a series of steps.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

As a developer, you are using a Docker container action in your workflow. What is required for the
action to run successfully?

  • A. The job env must be set to a Linux environment.
  • B. The job runs-on must specify a Linux machine with Docker installed.
  • C. The referenced action must be hosted on Docker Hub.
  • D. The action must be published to the GitHub Marketplace.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
For a Docker container action to run in a GitHub Actions workflow, the runner must have Docker
installed. The runs-on attribute of the job should specify an environment that supports Docker,
typically a Linux environment (e.g., ubuntu-latest), since Docker is widely supported and commonly
used in Linux-based environments.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

Which workflow commands send information from the runner? (Choose two.)

  • A. reading from environment variables
  • B. setting a debug message
  • C. populating variables in a Dockerfile
  • D. setting output parameters
Answer:

B, D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Setting a debug message using ::debug:: command sends a message to the logs, helping with
troubleshooting and providing insight into the workflow run.
Setting output parameters using ::set-output sends data from a job step to subsequent steps or jobs,
which can be used later in the workflow.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

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

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
The needs context is used to reference the outputs of jobs that are dependencies of the current job.
In this case, needs.job1.outputs.output1 correctly accesses the output of output1 from the job job1
in the dependent job.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

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

  • 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
Answer:

B, D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
F
50%

Explanation:
The key is required because it uniquely identifies the cache. It is used to store and retrieve cached
data. When creating or restoring a cache, you need to define a key that will be used to identify the
cache.
The path is the file path on the runner that you want to cache. This is where the cached files or
dependencies are located and should be specified to tell GitHub where to store or retrieve the cache
from.

Discussions
vote your answer:
A
B
C
D
E
F
0 / 1000

Question 15

What are the advantages of using a matrix strategy in a job definition? (Choose two.)

  • A. It can test code in multiple versions of a programming language.
  • B. It can decrease the costs for running multiple combinations of programming language/operating systems.
  • C. It can run up to 512 jobs per workflow run.
  • D. It can test code in multiple operating systems.
Answer:

A, D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
A matrix strategy allows you to define different versions of a programming language (or any other
environment setting) and run tests on each version simultaneously. This is particularly useful for
testing code compatibility across different versions of a language.
A matrix strategy can also be used to test code on multiple operating systems (e.g., Windows,
macOS, Linux) by defining these operating systems as matrix variables. This enables cross-platform
testing within the same workflow.

Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2