Questions for the GITHUB ACTIONS were updated on : Nov 21 ,2025
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?
D
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.
As a developer, your self-hosted runner sometimes looses connection while running jobs. How
should you troubleshoot the issue affecting your self-hosted runner?
C
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.
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?
C
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.
Which files are required for a Docker container action in addition to the source code? (Choose two.)
A, D
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).
As a developer, how can you identify a Docker container action on GitHub?
D
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.
Which run: command will set a step's output?
A
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.
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, D
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.
What is the right method to ensure users approve a workflow before the next step proceeds?
C
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.
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
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.
Which action type should be used to bundle a series of run steps into a reusable custom action?
A
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.
As a developer, you are using a Docker container action in your workflow. What is required for the
action to run successfully?
B
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.
Which workflow commands send information from the runner? (Choose two.)
B, D
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.
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent
job within a workflow?
A
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.
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.)
B, D
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.
What are the advantages of using a matrix strategy in a job definition? (Choose two.)
A, D
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.