GitHub Actions Online Practice Questions

Home / GitHub / GitHub Actions

Latest GitHub Actions Exam Practice Questions

The practice questions for GitHub Actions exam was last updated on 2025-09-15 .

Viewing page 1 out of 5 pages.

Viewing questions 1 out of 26 questions.

Question#1

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

Explanation:
The action.yml file defines the inputs and outputs for a GitHub Action. This file contains metadata about the action, including the required inputs and outputs, as well as other configurations like the action's description, runs, and environment setup.

Question#2

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.

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.

Question#3

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

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.

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

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

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.

Question#5

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

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.

Explanation:
The best way for an enterprise to control which GitHub Actions run is by creating a list of approved actions as an enterprise policy. This approach restricts workflows to only use the actions that are explicitly allowed, ensuring security and compliance within the organization.

Exam Code: GitHub ActionsQ & A: 72 Q&AsUpdated:  2025-09-15

 Get All GitHub Actions Q&As