GitHub Actions Free Practice Questions
This practice bank exercises foundational knowledge of GitHub Actions, including workflow definition (YAML files in .github/workflows/), triggering events (e.g., push), job and step structures, runner environments, and default shells. It also covers key features such as secrets for sensitive data, outputs for inter-step communication, strategy (max-parallel) for concurrency, reusable workflows (action keyword), conditional execution (if), environments for deployment rules, and the role of actions as shareable logic. Mastery of these components is essential for designing automated CI/CD pipelines that are secure, efficient, and maintainable.
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.
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.
Card 1 of 20
1 reviewed this session
Static practice bank
Start the 15-question diagnostic
The complete question bank is embedded in this pre-rendered page. There is no database request or second content download when you begin.
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.
Study workflow
Turn one GitHub Actions attempt into a study plan
- 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
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
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
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
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.
Build the next review session
Browse another free bank or use the study strategy guide to turn your misses into spaced review.
