SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
GH-200 · Domain 2

Consume and troubleshoot workflows practice questions

Consume and troubleshoot workflows is worth 19% of the GH-200 exam — the 3rd-heaviest of the 5 domains. Reading what a workflow did and why it failed: triggers, logs and run history, matrix expansions and reruns, artifacts via UI and API, and starter vs reusable workflows vs composite actions. Official weight range 15–20%. 6 fully worked examples are further down this page, answers included.

Exam weight
19%
the 3rd-heaviest of the 5 domains
Questions
71
across 2 topics
Free, no account
5/day
a free account allows 30 a day
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

Mode

Ready when you are

10 fresh questions drawn across 1 of 5 domains, in Learn mode.

Focused review

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Consume and troubleshoot workflows questions, fully explained

Questions from the GH-200 bank mapped to domain 2, with the answer key and the reasoning behind every option. None of them repeat the examples on the main GH-200 practice page.

Question 1Consume and troubleshoot workflows

A workflow in a repository has this trigger:on: push: branches: [main] pull_request: branches: [main]A developer pushes a commit to a new branch feature/login, opens a pull request from feature/login into main, pushes one more commit to feature/login, and finally merges the pull request. All work happens in the same repository. Which runs of this workflow appear in the Actions tab?

Choose one.

  • a
    Four runs: a push to feature/login, pull request opened, synchronize, and a push to main

    The push filter lists only main, so the first push to feature/login does not start a run.

  • b
    Three runs: pull request opened, pull request synchronize, and pull request closed

    closed is not a default pull_request activity type; the merge is recorded here as a push to main instead.

  • c
    Two runs: pull request opened and a push to main when the pull request is merged

    Pushing a new commit to the pull request's head branch is a synchronize activity, which is a default type and starts a run.

  • d
    Three runs: pull request opened, pull request synchronize, and a push to main Correct

    The first push is to a branch outside the push filter. Opening and updating the pull request are default pull_request activity types, and the merge pushes a commit to main.

The concept

Reading a trigger means combining branch filters for each event with the default activity types of pull_request, and knowing that a merge is a push to the base branch.

Why that’s the answer

The push event is filtered to main, so pushing to feature/login creates nothing. pull_request with branches: [main] filters on the base branch; with no types listed it runs for opened, synchronize and reopened, so opening the pull request and pushing another commit each start a run. Merging creates a commit on main, which is a push to main and starts the third run. A closed activity is not in the default list, so there is no separate run for closing.

How to reason it out
  1. Apply the push branch filter to each push: feature/login fails it, the merge into main passes it.
  2. Recall the default pull_request activity types: opened, synchronize and reopened.
  3. Match each action: open is opened, the extra commit is synchronize.
  4. Count the runs: two pull_request runs plus one push run.

Exam tip: pull_request without types runs on opened, synchronize and reopened; a merge shows up as a push to the base branch.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

Question 2Consume and troubleshoot workflows

A repository requires the status check "CI / test" before a pull request can merge into main. The CI workflow runs on pull_request with a paths filter of src/**, so a pull request that changes only files under docs/ waits with "CI / test" pending and cannot merge. The team wants docs-only pull requests to merge while every pull request that changes src/ still runs the tests. Which change achieves this?

Choose one.

  • a
    Swap the paths filter for a paths-ignore filter of docs/** on the pull_request trigger

    paths-ignore is still a workflow-level filter: a docs-only pull request creates no run, so the required check stays pending exactly as before.

  • b
    Have authors of pull requests that change docs put [skip ci] in their commit messages

    A skip instruction also prevents the run from being created, and a workflow skipped by a commit message leaves its checks pending.

  • c
    Set branch protection so CI / test is required for pull requests that change src/**

    Required status checks are set per protected branch or ruleset target, not per changed path, so this cannot be configured.

  • d
    Drop the paths filter and skip the test job with an if on a changed-files job's output Correct

    With no workflow-level filter a run always exists; a job skipped by its if condition reports Success, which satisfies the required check, while src/ changes still run the tests.

The concept

A workflow skipped by a path, branch or commit-message filter creates no run and leaves its checks pending, whereas a job skipped by an if condition reports Success.

Why that’s the answer

GitHub documents that when a workflow is skipped by path filtering, branch filtering or a commit message, the checks associated with it remain Pending, so a required check blocks the merge. Moving the decision inside the workflow fixes this: the workflow always runs, a first job works out which files changed, and the test job's if skips it for docs-only changes. A job skipped by a conditional reports Success, which satisfies the required check, and src/ changes still run the tests. paths-ignore and [skip ci] are just other ways of skipping the whole workflow, and branch protection cannot scope a required check by path.

How to reason it out
  1. Recall why the check is pending: no run exists because the trigger filter skipped the workflow.
  2. Reject any option that still skips the workflow at the trigger or commit level.
  3. Recall that a job skipped by its if condition reports Success to required checks.
  4. Choose the option that always creates a run and skips only the job.

Exam tip: Skipped workflows leave required checks pending; skip the job with if instead.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

Question 3Consume and troubleshoot workflows

A workflow runs on pull_request for pull request 42. Its first step is actions/checkout with default inputs, and the second step prints git rev-parse HEAD. A reviewer notices that the printed SHA matches no commit on the pull request's head branch. The workflow file has not been changed. What does the printed SHA identify?

Choose one.

  • a
    The latest commit on the base branch at the time the pull request was opened

    That describes the base branch tip, not the merge ref; checkout of refs/pull/42/merge includes the head branch changes.

  • b
    A rebase of the head branch commits onto the latest commit of the base branch

    GitHub does not rebase pull request commits for a pull_request run; it creates a merge commit on refs/pull/42/merge.

  • c
    The latest commit on the default branch, as used by pull_request_target runs

    Running on the default branch's last commit is pull_request_target behaviour; this workflow uses pull_request.

  • d
    A merge commit of the head branch into the base branch for pull request 42 Correct

    For pull_request, GITHUB_SHA is the last merge commit on the refs/pull/<number>/merge ref, and checkout fetches that commit by default.

The concept

For the pull_request event, GITHUB_SHA is the last merge commit on GITHUB_REF, which is refs/pull/<number>/merge.

Why that’s the answer

GitHub tests what the pull request would produce once merged: it creates a merge commit of the head branch into the base branch on refs/pull/<number>/merge, and the run's GITHUB_SHA is that commit. actions/checkout checks out GITHUB_SHA by default, so HEAD is the merge commit and its SHA matches no commit on the head branch. GitHub does not rebase the branch, the base branch tip lacks the pull request's changes, and the default-branch commit is what pull_request_target uses.

How to reason it out
  1. Note the event: pull_request, with checkout using its defaults.
  2. Recall that pull_request runs use GITHUB_REF refs/pull/<number>/merge.
  3. Recall that GITHUB_SHA is the last merge commit on that ref and checkout fetches it.
  4. Conclude that HEAD is a merge commit, not a head branch commit.

Exam tip: pull_request runs build refs/pull/N/merge, a merge commit, not the head branch tip.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

Question 4Consume and troubleshoot workflows

A JavaScript action in a repository calls core.debug() to print extra details, but none of those lines appear in the step logs of workflow runs. The maintainer wants those lines to appear in all future runs of the repository's workflows without editing any workflow file. What should the maintainer do?

Choose one.

  • a
    Create a repository variable named ACTIONS_RUNNER_DEBUG with the value true

    ACTIONS_RUNNER_DEBUG enables runner diagnostic logs, which go into the log archive; it does not show step debug messages.

  • b
    Add an env entry named RUNNER_DEBUG with the value 1 to each job

    RUNNER_DEBUG is set by the runner when debug logging is on; adding it yourself means editing every workflow file, which is ruled out.

  • c
    Re-run the latest failed run with the Enable debug logging option selected

    Re-running with debug logging turns on debug output for that one re-run only, not for all future runs.

  • d
    Create a repository variable named ACTIONS_STEP_DEBUG with the value true Correct

    ACTIONS_STEP_DEBUG set to true (as a secret or variable) enables step debug logging, which shows debug messages in the step logs.

The concept

Step debug logging is enabled by setting ACTIONS_STEP_DEBUG to true as a repository secret or variable; runner diagnostic logging uses ACTIONS_RUNNER_DEBUG.

Why that’s the answer

Debug messages (core.debug or the ::debug:: workflow command) are hidden unless step debug logging is enabled. Setting ACTIONS_STEP_DEBUG to true as a secret or variable in the repository turns it on for later runs with no workflow change. ACTIONS_RUNNER_DEBUG is the near-twin that adds runner diagnostic logs to the archive instead, RUNNER_DEBUG is an indicator the runner sets, and a CLI flag cannot reveal lines that were never logged.

How to reason it out
  1. Identify the output wanted: debug messages inside step logs.
  2. Match it to step debug logging, not runner diagnostic logging.
  3. Set ACTIONS_STEP_DEBUG to true as a secret or variable.
  4. Reject options that edit workflows or only change how logs are viewed.

Exam tip: ACTIONS_STEP_DEBUG shows debug messages in step logs; ACTIONS_RUNNER_DEBUG adds runner diagnostics.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

Question 5Consume and troubleshoot workflows

A deployment job failed once with an error that does not reproduce reliably. The team wants debug output from both the steps and the runner for another try of exactly that failed run. They must not commit any change and must not change repository settings that would affect other runs. What should they do?

Choose one.

  • a
    Set ACTIONS_STEP_DEBUG and ACTIONS_RUNNER_DEBUG to true as repository secrets

    These settings produce the logs, but they apply to every later run in the repository, which the team wants to avoid.

  • b
    Add a step that runs set -x before the deploy command and push the change

    Tracing commands needs a commit, and a new push starts a new run rather than retrying the failed one.

  • c
    Download the log archive of the failed run and open its diagnostic folder

    The runner-diagnostic-logs folder exists only when runner diagnostic logging was enabled for that run, which it was not.

  • d
    Re-run the failed jobs with the Enable debug logging option selected Correct

    A re-run can enable runner diagnostic logging and step debug logging for that re-run only, with no commit or settings change.

The concept

Debug logging can be turned on for a single re-run, in the UI or with gh run rerun --debug, without changing secrets or variables.

Why that’s the answer

When re-running a workflow or its failed jobs, anyone who can run the workflow can enable runner diagnostic logging and step debug logging for that re-run only. That retries the same run with full debug output, needs no commit, and does not affect other runs. Repository secrets or variables would enable debug logging for every subsequent run, adding set -x needs a commit, and the archive of the original run has no runner diagnostics because they were off.

How to reason it out
  1. List the constraints: same failed run, no commit, no repository-wide setting.
  2. Recall that a re-run can enable debug logging for itself.
  3. Choose the re-run with debug logging selected.
  4. Reject options that need a commit or affect every run.

Exam tip: Use re-run with debug logging for a one-off investigation; use the secrets or variables for ongoing debugging.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

Question 6Consume and troubleshoot workflows

A job on ubuntu-latest has this step:- name: Test run: npm test | tee test-output.txtThe step's log shows several failing tests and npm reporting an error, yet the step and the job are marked successful. The team wants the step to fail whenever npm test fails, and the test output must still be written to test-output.txt. Which change achieves this?

Choose one.

  • a
    Add shell: bash to the step Correct

    With shell: bash the runner uses bash --noprofile --norc -eo pipefail, so the failing npm test makes the pipeline fail.

  • b
    Add shell: sh to the step

    sh runs with -e but without pipefail, so the pipeline's status is still the exit code of tee.

  • c
    Add continue-on-error: false to the step

    false is already the default; the step is not failing at all, so there is nothing for this setting to change.

  • d
    Add if: success() to the step

    success() decides whether the step starts; it does not change how the step's exit code is computed.

The concept

On Linux and macOS, a run step with no shell uses bash -e {0}; shell: bash adds -o pipefail, so a failure anywhere in a pipeline fails the step.

Why that’s the answer

Without pipefail, a pipeline's exit status is the status of its last command. tee succeeds, so the step exits 0 even though npm test failed. When no shell is specified the runner uses bash -e {0}; when shell: bash is specified it uses bash --noprofile --norc -eo pipefail {0}, so the failed npm test fails the step while tee still writes the file. sh has no pipefail, continue-on-error is already false, and if only controls whether the step runs.

How to reason it out
  1. Spot the pipe: the step's status comes from tee.
  2. Recall the default shell command: bash -e, without pipefail.
  3. Recall that shell: bash adds -o pipefail.
  4. Reject settings that do not change the exit code.

Exam tip: An unspecified shell is bash -e; shell: bash adds pipefail, so piped failures fail the step.

Troubleshoot GitHub Actions Workflow Runs: Logs, Matrix Re-runs and Artifacts (GH-200) — the lesson that teaches this.

What GH-200 domain 2 tests, topic by topic

The official exam guide breaks Consume and troubleshoot workflows into 2 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published GH-200 practice questions per topic in Consume and troubleshoot workflows
TopicWhat it coversQuestions
Interpret workflow results, artifacts and logsOfficial GH-200 study guide, "Consume and troubleshoot workflows" (skills measured as of January 2026). "Interpret workflow behavior and results": Identify workflow triggers and effects from configuration and logs; Diagnose failed workflow runs using logs and run history; Expand and interpret YAML anchors, aliases, and merged mappings when analyzing workflow configuration; Interpret matrix expansions, correlate job names to matrix axes, analyze failures across variants, and selectively rerun individual matrix jobs. "Access workflow artifacts and logs": Locate workflows, logs, and artifacts in the UI and via API; Download and manage workflow artifacts.35
Use and manage workflow templatesOfficial GH-200 study guide, "Consume and troubleshoot workflows" (skills measured as of January 2026). "Use and manage workflow templates": Consume organization-level and reusable workflows; Consume non-public organization workflow templates; Use starter workflows (public and private/non-public templates); customize and adapt; distinguish from reusable workflows and composite actions; Differentiate starter workflows (copy scaffold, independent after creation) vs reusable workflows (central versioned definition invoked via workflow_call) vs composite actions (encapsulated step logic); Contrast disabling and deleting workflows.36
Total71

Revise Consume and troubleshoot workflows before you drill it

Other GH-200 domains

Consume and troubleshoot workflows: your questions

Consume and troubleshoot workflows is domain 2 of the GH-200 exam guide and carries 19% of the scored content — the 3rd-heaviest of the 5 domains. On a 60-question paper that works out to roughly 11 questions, though GitHub does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official GH-200 exam guide.