GitHub Actions Certification Exam-style mock test
GitHub Actions Certification Practice Exams|Practice test
Full explanations
Exam format
Pass line 70%
33 USD One-time · lifetime access
Enroll →
Sample questions
Example1 · Workflow Authoring, Events, and Triggers
At the B2B SaaS company Northwind Billing, the platform team wants a CI workflow to run only when commits are pushed to the main branch and only when files under the billing-service/ directory change. Which trigger configuration achieves this?
✓on: { push: { branches: [main], paths: ['billing-service/**'] } }
Correct. The push event supports both a branches filter and a paths filter, so the workflow runs only for pushes to main that touch billing-service/**.
・on: { pull_request: { branches: [main] }, paths: ['billing-service/**'] }
Incorrect. pull_request reacts to PR activity rather than pushes, and the paths key is misplaced outside the event block here.
・on: { push: { tags: [main] } }
Incorrect. The tags filter matches Git tag names, not branches, so pushes to the main branch would not match.
・on: { workflow_dispatch: { inputs: { branch: main, path: billing-service } } }
Incorrect. workflow_dispatch triggers only on manual runs and does not automatically fire on pushes.
Explanation
The push event combines branches and paths filters to scope automatic runs to a specific branch and changed files, which is exactly what the billing team needs.
Example2 · Jobs, Steps, Runners, and Matrix Builds
At the B2B SaaS company Flowmetric, a platform engineer is reviewing a workflow that lints, tests, and packages the billing service. A teammate asks how steps relate to jobs in GitHub Actions. Which statement correctly describes the relationship?
・Each step runs on its own separately provisioned runner, while the job merely groups the individual step results together afterward.
Incorrect. Steps share the same runner and filesystem within a job; they are not each assigned a separate runner.
✓A job is a set of steps that run on the same runner, executing sequentially in order.
Correct. A job groups steps that all run on the same runner, and those steps execute sequentially in the order listed.
・Steps always run in parallel within a job unless needs declares a dependency between them.
Incorrect. Steps run sequentially by default, not in parallel; needs applies to jobs, not steps.
・A step can contain multiple jobs, reusing several runners within one step definition.
Incorrect. The nesting is reversed: jobs contain steps, not the other way around.
Explanation
A job is a collection of steps that share a single runner environment, and steps run one after another in the order they are defined.
Example3 · Actions, Marketplace, and Reusable Workflows
A platform engineer at a B2B SaaS company is adding a workflow step that checks out the repository before running tests. They want to reference the official checkout action from GitHub Marketplace in the most standard, documented way. Which step syntax should they use?
・Use run: actions/checkout@v4 here
Incorrect. The run keyword executes shell commands, not Marketplace actions, so this step would try to run an invalid command.
✓Use uses: actions/checkout@v4 in steps
Correct. Actions from Marketplace are consumed with the uses keyword followed by owner/repo@ref, such as actions/checkout@v4.
・Use action: github.com/actions/checkout as the reference
Incorrect. There is no action keyword for steps, and referencing a bare github.com URL is not the supported consumption syntax.
・Use import: actions/checkout@v4 instead
Incorrect. There is no import keyword in GitHub Actions step syntax for pulling in a Marketplace action.
Explanation
Marketplace and repository-based actions are referenced in a step using the uses keyword with the owner/repo@ref format.
Example4 · Secrets, Variables, Environments, and Security
A healthcare services firm's platform team stores the non-sensitive default log level for its patient-portal pipeline so that workflows can read it without exposing anything confidential. For the database password used by the same pipeline, they need a value that is encrypted at rest and masked in logs. Which pairing correctly matches each need?
✓Store the log level as a configuration variable and the database password as an encrypted secret value
Correct. Non-sensitive values like a log level belong in configuration variables, while credentials such as a database password must be encrypted secrets so they are stored encrypted and masked.
・Store both the log level and the database password as encrypted secrets
Incorrect. A plain log level does not need encryption, and overusing secrets for non-sensitive data adds needless management overhead.
・Store the log level as an encrypted secret and the database password as a configuration variable
Incorrect. This reverses the proper usage, leaving the password exposed as a readable variable.
・Store both the log level and the database password as configuration variables
Incorrect. Configuration variables are not encrypted or masked, so the database password would be exposed in logs.
Explanation
Secrets are encrypted and masked for sensitive data; configuration variables hold non-sensitive values in plaintext.
Example5 · CI/CD Patterns, Artifacts, and Troubleshooting
At MercyBridge Health, a build job compiles the patient-portal bundle into a dist/ folder, and a separate deploy job in the same workflow needs those compiled files. The deploy job runs on a different runner. How should the engineer move the compiled output from the build job to the deploy job?
・Reference the dist/ folder directly in the deploy job, since jobs share one working directory on disk
Incorrect. Each job runs on a fresh runner instance with its own filesystem, so the deploy job cannot see the build job's dist/ folder directly.
✓In the build job use actions/upload-artifact to save dist/, then in the deploy job use actions/download-artifact to retrieve the compiled bundle onto its runner
Correct. Artifacts are the supported mechanism for persisting files from one job and retrieving them in another; upload-artifact saves dist/ and download-artifact restores it on the deploy runner.
・Commit the dist/ folder back to the repository from the build job so the deploy job can check it out
Incorrect. Committing build output back to the repo is an anti-pattern that pollutes history and risks loops; it is not how output is passed between jobs.
・Store the dist/ files in a job output using the GITHUB_OUTPUT file and read them in the deploy job
Incorrect. Job outputs via GITHUB_OUTPUT are for small string values, not for transferring directories of compiled files.
Explanation
Because jobs do not share a filesystem, build artifacts must be uploaded in the producing job and downloaded in the consuming job.
Example6 · Workflow Authoring, Events, and Triggers
At MercyBridge Health Systems, a DevOps engineer needs a workflow that runs automatically whenever clinicians push updates to the patient-portal repository, but only when they target the main branch. Which on configuration achieves this?
・on: push every branch
Incorrect. A bare push trigger runs on pushes to every branch, not just main, so it does not satisfy the branch restriction.
✓on:
push:
branches:
- main
Correct. Specifying push with a branches filter of main scopes the workflow to run only on pushes targeting the main branch.
・on:
pull_request:
branches: [main] only here
Incorrect. The pull_request event fires on pull request activity, not on direct pushes to a branch.
・on:
schedule:
- cron nightly
Incorrect. A schedule trigger runs on a cron timer and is unrelated to pushes made by clinicians.
Explanation
Using push with a branches filter restricts the workflow to the specified branch, which is exactly the targeted-branch behavior required.
Example7 · Workflow Authoring, Events, and Triggers
The UrbanThread retail platform team wants a single workflow to run both when code is pushed to the main branch and every night at 02:00 UTC to rebuild the product catalog cache. How should the on: key be configured?
✓List push plus a schedule entry whose cron '0 2 * * *' rebuilds the catalog nightly
Correct. A single workflow can subscribe to several events by listing both push and schedule (with a cron expression) under the on: key.
・Create two separate workflow files because a workflow declares one event
Incorrect. A workflow can respond to multiple events, so splitting into two files is unnecessary.
・Use on: push and rely on a branch protection rule nightly
Incorrect. Branch protection rules govern merges and reviews; they do not schedule workflow runs.
・Set on: workflow_dispatch and manually trigger the build each night
Incorrect. workflow_dispatch requires a manual click and cannot run automatically on a nightly schedule.
Explanation
Multiple triggers, including scheduled cron runs, can coexist under a single on: key.
Example8 · Workflow Authoring, Events, and Triggers
UrbanThread wants a workflow to run only when pushes modify files inside the checkout/ directory on the main branch. Which configuration achieves this most precisely?
✓Combine branches and paths filters together under on.push
Correct. Combining a branches filter with a paths filter restricts the trigger to pushes on main that touch files under checkout/.
・Run on.push unfiltered, then add an early-exit conditional first step in the job
Incorrect. Running the whole workflow then exiting wastes a runner and is less precise than event-level filters.
・Use on.push with only a main branches filter and accept all changes
Incorrect. A branches filter alone still triggers on any file change, not just the checkout/ directory.
・Switch to on.pull_request targeting main so reviewed checkout changes trigger it
Incorrect. Switching to pull_request changes the event and still would not scope by path without a paths filter.
Explanation
Event-level branches and paths filters together give the most precise trigger scoping.
Example9 · Workflow Authoring, Events, and Triggers
The UrbanThread release engineer needs to launch a deployment workflow on demand and choose a target environment (staging or production) at launch time. Which event supports accepting typed inputs from the Actions UI?
✓Use workflow_dispatch, accepting typed inputs supplied from the Actions UI
Correct. workflow_dispatch lets you define inputs that the user supplies from the Actions UI when manually running the workflow.
・Use repository_dispatch, which is triggered by an external REST POST client payload
Incorrect. repository_dispatch is triggered by an external API POST and uses a client payload rather than UI form inputs.
・Use the automatic commit-driven push event instead today
Incorrect. push fires automatically on commits and does not present an input form.
・Use the scheduled nightly cron timing event here
Incorrect. schedule runs on cron timing with no opportunity for user-supplied inputs.
Explanation
workflow_dispatch is the manual trigger that supports defining and collecting inputs in the UI.
Example10 · Workflow Authoring, Events, and Triggers
A payments team at a financial services company wants their CI workflow to run whenever a developer pushes commits to the long-lived release branch named release/2024-q3, but not for pushes to any other branch. Which trigger configuration achieves this?
✓on:
push:
branches:
- 'release/2024-q3' # for this trigger
Correct. Using push with a branches filter set to the specific branch name restricts the workflow to run only on pushes to release/2024-q3.
・on:
push:
tags:
- 'release/2024-q3' # the tags filter matches Git tags, not branches
Incorrect. The tags filter matches Git tags, not branches, so pushes to the release branch would not trigger it.
・on:
push:
branches-ignore:
- 'release/2024-q3' # excludes exactly the one branch we need
Incorrect. The branches-ignore filter skips the named branch, which is the exact opposite of the stated requirement.
・on:
pull_request:
branches:
- 'release/2024-q3' # runs on pull requests rather than pushes
Incorrect. The pull_request event runs on pull request activity, not on direct pushes to the branch.
Explanation
A branches filter under the push event scopes the trigger to the named branch, while tag filters and the pull_request event address different activities.
Example11 · Workflow Authoring, Events, and Triggers
A bank's monorepo contains a fraud-detection service under services/fraud/. The DevOps engineer wants the fraud service workflow to trigger on pushes only when files inside that directory change. Which configuration is correct?
✓on:
push:
paths:
- 'services/fraud/**' # runs only when files here change
Correct. The paths filter with the services/fraud/** glob makes the workflow run only when matching files under that directory are changed.
・on:
push:
paths-ignore:
- 'services/fraud/**' # skips the workflow when only those files change in the tree
Incorrect. paths-ignore has the opposite effect, skipping the workflow when only those files change.
・on:
push:
branches:
- 'services/fraud/**' # for this job configuration
Incorrect. The branches key filters by branch name, not by changed file paths.
・on:
push:
paths:
- 'services/fraud' # a literal path with no recursive glob
Incorrect. Without the ** recursive glob this pattern matches a file literally named services/fraud, not contents of the directory.
Explanation
The paths filter with a recursive glob includes the workflow only when matching files change, whereas paths-ignore excludes and branches is unrelated to file paths.
Example12 · Workflow Authoring, Events, and Triggers
At Meridian Industrial Supply, a distributor of hydraulic fittings, the platform team wants a workflow to run only when a developer opens or updates a pull request that targets the main branch, so the test suite validates changes before merge. Which event configuration meets this requirement?
・on: the push event
Incorrect. The push event fires on commits to branches and does not represent the opening or updating of a pull request.
✓on: the pull_request webhook event
Correct. The pull_request event fires when a pull request is opened, synchronized, or reopened, which is exactly the review-before-merge scenario described.
・on: workflow_dispatch for manual runs only
Incorrect. The workflow_dispatch event only runs when a user manually starts the workflow, not automatically on pull request activity.
・on: the schedule cron event
Incorrect. The schedule event runs the workflow on a cron timer and has no awareness of pull request activity.
Explanation
The pull_request event is the standard trigger for validating proposed changes targeting a branch before they are merged.
Example13 · Workflow Authoring, Events, and Triggers
Meridian's warehouse automation team wants a labeling workflow to run only when an issue is first created, not every time an issue is edited or commented on. Which configuration correctly narrows the pull_request-style issue trigger to that single activity?
✓on:
issues:
types: [opened]
Correct. Specifying types: [opened] limits the issues event so the workflow runs only when an issue is created.
・on:
issues:
types: [opened, edited]
Incorrect. Listing edited alongside opened would also run the workflow when issues are modified, beyond creation.
・on: bare issues
Incorrect. Bare on: issues triggers on the default set of all issue activity types, not only creation.
・on:
issue_comment:
types: [created]
Incorrect. The issue_comment event responds to comments being added, which is a different event than an issue being opened.
Explanation
Activity type filters let you scope an event to specific actions; listing only opened restricts the issues event to creation.
Example14 · Workflow Authoring, Events, and Triggers
A telecom operator's platform team wants a workflow to run automatically whenever an engineer opens or updates a pull request that targets the main branch of the billing-gateway repository. Which event key should be configured at the top of the workflow file?
・schedule, using a cron expression that polls the repository every few minutes looking for newly opened pull requests
Incorrect. The schedule event only runs on a time-based cron and cannot react to pull request activity as it happens.
✓pull_request, which fires on activity such as opened and synchronize against the targeted branch
Correct. The pull_request event fires on pull request activity types including opened and synchronize, which covers opening and updating a PR against main.
・push, because every pull request update is internally represented as a branch push
Incorrect. A push event fires on commits pushed to a branch or tag, not on the lifecycle of a pull request.
・repository_dispatch, with a custom event type sent externally through the API
Incorrect. repository_dispatch is for external custom events sent via the API, not for native pull request activity.
Explanation
Pull request lifecycle automation is driven by the pull_request event, whose activity types include opened and synchronize.
Example15 · Workflow Authoring, Events, and Triggers
The network provisioning team at a telecom operator wants their deployment workflow to run on pushes only to main and to any branch beginning with release/. Which trigger configuration achieves this?
✓on: push: branches: [ 'main', 'release/**' ] restricting the trigger to main and all release branches
Correct. The branches filter with 'main' and the glob 'release/**' restricts the push trigger to exactly those branch names.
・on: push: tags: [ 'main', 'release/*' ] which only matches Git tags
Incorrect. The tags filter matches Git tags rather than branches, so pushes to the branches would not trigger it.
・on: push: paths: [ 'main', 'release/' ] which only matches changed file paths
Incorrect. The paths filter matches changed file paths, not branch names, so it does not scope by branch.
・on: [push] plus a branches-ignore block listing every other branch by name
Incorrect. Enumerating every other branch in branches-ignore is unmanageable and still would not cleanly include release/** branches.
Explanation
Branch-scoped triggers use the branches filter with glob patterns, and 'release/**' matches all release branches.
▶ Try 10 free questions (graded)