Free practice · No sign-up required

GitHub Actions free practice test

15 questions with answer explanations. Choose an answer below to begin.

Question 1 of 15

Which GitHub feature allows you to define workflows using YAML files stored in the repository?

Show hint

Understand core components and terminology of GitHub Actions.

0/15 answered · Bookmark questions to review later. Focus the practice area to use keys 1–9 and Enter.

Learn by doing

Put your answers into practice

Use official documentation and hands-on labs to work through topics you missed.

Explore all study resources →

All questions and explanations

Prefer to read at your own pace? Work through each question below, then open its answer to check your reasoning. You can link directly to a question or print this reference.

  1. Which GitHub feature allows you to define workflows using YAML files stored in the repository?

    1. Actions

    2. Insights

    3. Environments

    4. Secrets

    Show answer and explanation

    Correct answer

    • Actions

    GitHub Actions uses YAML workflow files stored in the .github/workflows directory to define automated processes. These workflows can be triggered by various events such as pushes or pull requests.

  2. What is the primary purpose of a workflow file in GitHub Actions?

    1. To define automated processes and steps

    2. To manage repository permissions

    3. To store secrets securely

    4. To track issues and pull requests

    Show answer and explanation

    Correct answer

    • To define automated processes and steps

    A workflow file describes a series of automated steps that run in response to defined events. It specifies jobs, steps, and the environment in which they execute.

  3. Which event triggers a workflow when code is pushed to the main branch?

    1. push

    2. pull_request

    3. schedule

    4. workflow_dispatch

    Show answer and explanation

    Correct answer

    • push

    The push event is used to trigger workflows when commits are pushed to a branch. It can be filtered to specific branches like main.

  4. What is the default shell used by GitHub Actions when running steps on Ubuntu runners?

    1. bash

    2. pwsh

    3. cmd

    4. sh

    Show answer and explanation

    Correct answer

    • bash

    On Ubuntu runners, the default shell for running commands is bash. This can be changed using the shell keyword if needed.

  5. Which keyword is used to reference outputs from one step to another within the same job?

    1. needs

    2. outputs

    3. steps

    4. env

    Show answer and explanation

    Correct answer

    • outputs

    The outputs keyword allows a step to define data that can be accessed by subsequent steps using steps..outputs..

  6. What is the purpose of the jobs..strategy.max-parallel setting in a workflow?

    1. To limit the number of concurrent job runs

    2. To set the maximum number of steps in a job

    3. To define the runner label

    4. To control retry attempts

    Show answer and explanation

    Correct answer

    • To limit the number of concurrent job runs

    This setting controls how many matrix job instances can run simultaneously. It helps manage resource usage and concurrency limits.

  7. Which of the following is used to securely store sensitive information such as API keys in GitHub Actions?

    1. Secrets

    2. Variables

    3. Artifacts

    4. Environments

    Show answer and explanation

    Correct answer

    • Secrets

    GitHub Secrets allow you to store encrypted values that can be accessed in workflows. They are not exposed in logs and are only passed to steps that explicitly request them.

  8. What does a job in a GitHub Actions workflow represent?

    1. A single step in a workflow

    2. A collection of steps that run on the same runner

    3. A trigger for starting workflows

    4. A repository permission setting

    Show answer and explanation

    Correct answer

    • A collection of steps that run on the same runner

    A job is a set of steps that execute on the same runner machine. Jobs can run independently or depend on other jobs using the needs keyword.

  9. Which keyword allows a workflow to reuse a set of steps across multiple jobs?

    1. composite

    2. reusable

    3. template

    4. action

    Show answer and explanation

    Correct answer

    • action

    Reusable workflows are defined in a separate file and can be called from other workflows using the workflow_call trigger. They promote DRY principles.

  10. Question 10

    Link to question

    What is the purpose of the if conditional in a workflow step?

    1. To skip the step based on a condition

    2. To define the runner label

    3. To set environment variables

    4. To trigger another workflow

    Show answer and explanation

    Correct answer

    • To skip the step based on a condition

    The if statement allows a step to run only when a specified condition evaluates to true. This helps control workflow execution dynamically.

  11. Question 11

    Link to question

    Which GitHub Actions feature enables you to create custom logic that can be shared across workflows?

    1. Actions

    2. Environments

    3. Secrets

    4. Runners

    Show answer and explanation

    Correct answer

    • Actions

    Actions are reusable units of code that can encapsulate a single command or a set of commands. They can be published and shared across workflows.

  12. Question 12

    Link to question

    What is the default concurrency behavior for GitHub Actions workflows in a repository?

    1. All workflows run sequentially

    2. Multiple workflows can run in parallel

    3. Only one workflow can run at a time

    4. Concurrency is disabled by default

    Show answer and explanation

    Correct answer

    • Multiple workflows can run in parallel

    By default, multiple workflows can run concurrently. You can limit concurrency using the concurrency keyword to prevent overlapping runs.

  13. Question 13

    Link to question

    Which file path is used to store workflow definitions in a GitHub repository?

    1. .github/workflows/

    2. .git/actions/

    3. workflows/.github/

    4. actions/

    Show answer and explanation

    Correct answer

    • .github/workflows/

    Workflow files must be placed in the .github/workflows directory at the root of the repository. GitHub automatically detects and runs these workflows.

  14. Question 14

    Link to question

    What is the role of a runner in GitHub Actions?

    1. To host and execute workflow jobs

    2. To manage repository settings

    3. To review pull requests

    4. To store workflow logs

    Show answer and explanation

    Correct answer

    • To host and execute workflow jobs

    A runner is a machine that runs your workflow jobs. It can be hosted by GitHub or self-hosted depending on your needs and permissions.

  15. Question 15

    Link to question

    Which feature allows you to define different deployment strategies for environments?

    1. Environments

    2. Secrets

    3. Labels

    4. Contexts

    Show answer and explanation

    Correct answer

    • Environments

    Environments in GitHub Actions let you define deployment targets and associate protection rules, reviewers, and secrets specific to each environment.

Read all flashcards

Recall the answer before opening each card.

Where are workflow definition files stored in a GitHub repository?

.github/workflows/ directory at the repository root. All YAML files in that folder are treated as workflows.

What event triggers a workflow when code is pushed to a branch?

The push event. It can be filtered by branch (e.g., on: push: branches: [main]).

What is the default shell on Ubuntu runners in GitHub Actions?

bash. It can be overridden using the shell keyword in a step.

How do you reference outputs from a previous step in the same job?

Use steps. .outputs. within the workflow. The step must define outputs using the outputs keyword.

What does jobs. .strategy.max-parallel control?

The maximum number of concurrent matrix job instances that can run at the same time.

How are sensitive values like API keys stored securely in GitHub Actions?

As GitHub Secrets. They are encrypted and only passed to steps that explicitly reference them; never exposed in logs.

What does a job represent in a GitHub Actions workflow?

A collection of steps that run on the same runner. Jobs can run independently or depend on other jobs using the needs keyword.

Which keyword is used to call a reusable workflow from another workflow?

workflow_call. It is defined in the reusable workflow as a trigger, and the caller uses the uses keyword with a path or reference.

What does the if conditional do in a workflow step?

It allows the step to run only when a specified condition evaluates to true. Otherwise, the step is skipped.

What is the role of an action in GitHub Actions?

A reusable unit of custom logic that encapsulates commands in a single step. Actions can be shared across workflows.

What is the default concurrency behavior for workflows in a repository?

Multiple workflows can run in parallel simultaneously with no limit. Use the concurrency keyword to restrict overlapping runs.

What file path must workflow definitions follow?

.github/workflows/ at the root of the repository. Workflow files are YAML and named descriptively (e.g., ci.yml).

What is a runner in GitHub Actions?

A machine (hosted by GitHub or self-hosted) that executes workflow jobs. Runners have a configured operating system and environment.

What feature allows defining different deployment targets with approval rules?

Environments. They can have protection rules, required reviewers, and secrets specific to that environment.

How can you limit the number of concurrent runs of a workflow?

By using the concurrency keyword with a group name. For example, concurrency: group: {{ github.workflow }} cancel-in-progress: true.

What is the purpose of the shell keyword in a step?

To override the default shell for that step. For example, shell: pwsh to use PowerShell.

Which trigger event is used to run a workflow on pull request activity?

pull_request. It can be filtered by types (e.g., opened, synchronize).

How are outputs from a job made available to downstream jobs?

Use the outputs keyword at the job level and access them via needs. .outputs. .

What does the action keyword do in a workflow step?

It specifies the path to an action to run. The action can be in a public repository, local path, or Docker image.

What is the purpose of the needs keyword in a job?

To define job dependencies. The job will wait for all specified upstream jobs to complete successfully before starting.

Active recall deck

Practice GitHub Actions with real flashcards

Read the prompt, commit to an answer, then flip the card. Move through the deck at your own pace and repeat any topic that does not come back quickly.

20 free cards

Card 1 of 20

1 reviewed this session

Connect the concepts

Your GitHub Actions study mind map

Open a branch to connect a topic with its practice questions and explanations. Use the map to choose your next review topic.

GitHub Actions15 questions in this practice set
Understand core components and terminology of GitHub Actions.(1)
Understand the role of workflow files in defining CI/CD pipelines.(1)
Identify common workflow trigger events.(1)
Know the default execution environment for runners.(1)
Understand step-to-step communication within a job.(1)
Manage job execution strategies and concurrency.(1)
Securely manage sensitive data in workflows.(1)
Understand the structure of jobs within a workflow.(1)
Leverage reusable workflows for modular pipeline design.(1)
Control step execution using conditional logic.(1)
Understand the concept and use of custom actions.(1)
Manage workflow execution concurrency.(1)
More practice connections(3)
Exam-focused analysis

What this GitHub Actions practice set measures

This is an analysis of the practice bank, not a claim about the vendor's live exam blueprint. Use it to identify the knowledge, judgment, and recall patterns exercised here, then verify your coverage against the current official exam guide.

Core Workflow Concepts

Workflows are defined in YAML files stored in .github/workflows/ at the repository root. Each workflow consists of one or more jobs, and each job contains a series of steps that run on the same runner. A runner (hosted or self-hosted) is the machine that executes the job. On Ubuntu runners, the default shell is bash. The primary purpose of a workflow file is to define automated processes triggered by events like push.

  • Workflow files reside in .github/workflows/ directory.
  • Jobs run on a single runner and group related steps.
  • Steps are individual tasks, using bash by default on Ubuntu runners.
  • The push event triggers a workflow when code is pushed to a branch.

Trigger and Execution Control

Workflows are triggered by events (e.g., push, pull_request). The if conditional allows steps or jobs to run only when a condition is met, enabling dynamic pipelines. The strategy.max-parallel setting controls how many concurrent matrix job instances execute. By default, multiple workflows can run in parallel; concurrency can be limited via the concurrency keyword. Outputs from one step can be passed to later steps using the outputs keyword.

  • if condition controls step execution based on criteria.
  • max-parallel limits simultaneous matrix job runs.
  • Default concurrency allows multiple workflows to run at once.
  • outputs keyword enables step-to-step data sharing within a job.

Security and Management

Sensitive information like API keys is stored securely using GitHub Secrets. Secrets are encrypted and not exposed in logs; they are only accessible to steps that explicitly reference them. Environments provide a way to manage deployment targets with protection rules, reviewers, and environment-specific secrets. This ensures that sensitive data and deployment approvals are enforced per environment (e.g., production vs. staging).

  • GitHub Secrets store encrypted sensitive data for workflows.
  • Secrets are never printed in logs and are only passed on request.
  • Environments group deployment targets with custom rules and secrets.
  • Environment protection rules can require approvals before deployment.

Advanced Features: Reusable Workflows and Actions

Reusable workflows (defined via the workflow_call trigger) allow you to call a workflow from another workflow, promoting DRY principles. The action keyword is used to reference a composite or Docker action that encapsulates custom logic. Actions are the building blocks of workflows; they can be published and shared across repositories. Understanding these features helps modularize pipelines and reduce duplication.

  • Reusable workflows are called using the workflow_call trigger.
  • Actions are reusable units of code, sharable across workflows.
  • Composite actions bundle multiple steps into a single action.
  • The action keyword references a specific action in a step.

Study workflow

Turn one GitHub Actions attempt into a study plan

  1. 1

    Review Core Syntax

    Read the GitHub Actions documentation on workflow syntax. Pay special attention to the structure: name, on, jobs, runs-on, steps. Practice writing a simple workflow that runs on push to main and echoes a message.

  2. 2

    Experiment with Triggers and Conditionals

    Create workflows with different triggers (push, pull_request) and use the if conditional with expressions like success() or variables. Observe how jobs are skipped or run based on conditions.

  3. 3

    Manage Secrets and Environments

    Set up a repository secret and use it in a workflow (e.g., ${{ secrets.MY_SECRET }}). Create an environment with required reviewers and deploy a job to that environment to see approval in action.

  4. 4

    Use Job Outputs and Matrix Strategies

    Define a job that generates an output and pass it to a dependent job. Implement a matrix strategy with strategy.matrix and test the max-parallel setting to control concurrency.

  5. 5

    Create a Reusable Workflow and Custom Action

    Write a reusable workflow in .github/workflows/ with on: workflow_call. Then call it from another workflow. Next, create a simple composite action and use it in a step to encapsulate a command.

FAQ

Questions about this exam practice page

Clear boundaries on what the bank covers, how to use it, and where official vendor information still matters.

What is the default shell on GitHub Actions Ubuntu runners?+

The default shell on Ubuntu runners is bash. This can be changed using the shell keyword in a step to other options like pwsh, python, or sh.

How do you pass data from one step to another in GitHub Actions?+

Use the outputs keyword to define output variables in a step, then reference them in subsequent steps using steps.<step_id>.outputs.<output_name>.

What is the difference between a job and a step in a workflow?+

A job is a collection of steps that run on the same runner. Steps are individual tasks within a job, such as running a command or using an action. Jobs can run in parallel or depend on others.

Can GitHub Actions workflows run on Windows runners by default?+

Yes, GitHub provides hosted runners for Windows, Ubuntu, and macOS. The runs-on keyword specifies the operating system. Windows runners use PowerShell as the default shell.

How do you prevent multiple workflow runs from overlapping in GitHub Actions?+

Use the concurrency keyword in a workflow to group runs by a key. This ensures that only one run per group executes at a time, cancelling any queued or running runs if a new one starts.

Keep studying

Build the next review session

Browse another free bank or use the study strategy guide to turn your misses into spaced review.