📝 Workflow Syntax & Structure - GH-ACTIONS Practice Questions

Learn GitHub Actions workflow YAML syntax: triggers, jobs, steps, actions, expressions, and contexts.

23Questions Available
2Exam Domains

Practice Workflow Syntax Questions Now

Start a timed practice session focusing on Workflow Syntax & Structure topics from the GH-ACTIONS question bank.

Start GH-ACTIONS Practice Quiz →

GH-ACTIONS Workflow Syntax Question Bank (23 Questions)

Browse all 23 practice questions covering Workflow Syntax & Structure for the GH-ACTIONS certification exam. Answers are intentionally hidden on this page so you can self-test first before checking results in quiz mode.

  1. Question 1Author and Manage Workflows

    What GitHub Actions context variable contains the name of the branch that triggered a push workflow?

    A${{ env.BRANCH }}
    B${{ github.ref }}
    C${{ runner.branch }}
    D${{ steps.branch.outputs.name }}

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  2. Question 2Author and Manage Workflows

    In a GitHub Actions workflow YAML file, what key defines the event that triggers the workflow?

    Atrigger
    Bon
    Cwhen
    Devents

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  3. Question 3Author and Manage Workflows

    By default, how do jobs in a GitHub Actions workflow run?

    ASequentially, one after another
    BIn parallel
    CIn alphabetical order
    DOnly one job can exist per workflow

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  4. Question 4Author and Manage Workflows

    Which trigger allows a workflow to be started manually from the GitHub UI or via the API?

    Aworkflow_run
    Brepository_dispatch
    Cworkflow_dispatch
    Dmanual_trigger

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  5. Question 5Author and Manage Workflows

    What is the smallest unit of work in a GitHub Actions workflow?

    AWorkflow
    BJob
    CStep
    DRunner

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  6. Question 6Author and Manage Workflows

    What file format is used to write GitHub Actions workflows?

    AJSON
    BTOML
    CYAML
    DXML

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  7. Question 7Author and Manage Workflows

    Where must GitHub Actions workflow files be placed in a repository?

    A/.workflows/ directory
    B/.github/workflows/ directory
    C/actions/ directory
    DAny directory, as long as the file ends in .yml

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  8. Question 8Consume and Troubleshoot Workflows

    How do you call a reusable workflow from another workflow in GitHub Actions?

    Auses: ./.github/workflows/reusable.yml
    Bimport: ./.github/workflows/reusable.yml
    Cinclude: reusable.yml
    Dworkflow_call: .github/workflows/reusable.yml

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  9. Question 9Author and Manage Workflows

    Which action caches dependencies in GitHub Actions to speed up workflows?

    Aactions/setup-cache
    Bactions/cache
    Cactions/save-artifacts
    Dactions/restore

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  10. Question 10Manage GitHub Actions for the Enterprise

    How do you target a specific self-hosted runner in a GitHub Actions workflow?

    ABy setting the runner IP address in the workflow
    BBy using labels in the runs-on: field of a job
    CBy naming the runner the same as the job name
    DSelf-hosted runners are always selected automatically

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  11. Question 11Secure and Optimize Automation

    In GitHub Actions, how do you reference an encrypted secret named API_KEY in a workflow step?

    A${{ secret.API_KEY }}
    B${{ secrets.API_KEY }}
    Cenv:API_KEY
    D${{ env.secrets.API_KEY }}

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  12. Question 12Author and Maintain Workflows

    Where must GitHub Actions workflow files be stored?

    AIn the root directory
    BIn the .github/workflows/ directory
    CIn the src/ directory
    DIn any directory

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  13. Question 13Author and Maintain Workflows

    Which keyword defines the events that trigger a workflow?

    Aruns-on
    Bsteps
    Con
    Djobs

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  14. Question 14Author and Maintain Workflows

    What is the purpose of 'workflow_dispatch' trigger?

    AAutomatic trigger on push
    BAllows manual triggering of a workflow from the GitHub UI or API with optional input parameters
    CScheduled trigger
    DTrigger on issue creation

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  15. Question 15Consume Workflows

    How do you debug a failing GitHub Actions workflow?

    AOnly read error messages
    BEnable debug logging (ACTIONS_RUNNER_DEBUG secret), add debug echo statements, use tmate for SSH access, and analyze step logs
    CCannot debug workflows
    DContact GitHub support

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  16. Question 16Author and Maintain Workflows

    How do you handle secrets in GitHub Actions workflows?

    AHardcode in YAML
    BStore in repository or organization Settings > Secrets, reference as ${{ secrets.NAME }}, and they are automatically masked in logs
    CEnvironment variables in code
    DPlain text files

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  17. Question 17Consume Workflows

    What are GitHub Actions starter workflows?

    ADefault workflows
    BPre-configured workflow templates provided by GitHub and organizations, available when setting up Actions for the first time, covering common CI/CD patterns for various languages
    CTraining courses
    DDemo workflows

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  18. Question 18Manage Actions and Workflows

    How do you debug failing GitHub Actions workflows?

    ACannot debug
    BEnable debug logging with ACTIONS_STEP_DEBUG secret, check run logs in Actions tab, use 'act' for local testing, and add diagnostic steps to workflows
    COnly re-run workflow
    DOnly check email

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  19. Question 19Author and Maintain Workflows

    What are expressions and functions in GitHub Actions?

    AProgramming code
    B${{ }} syntax for dynamic values, with built-in functions like contains(), startsWith(), format(), toJSON(), hashFiles(), and context objects like github, env, steps
    CTemplate literals
    DShell variables

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  20. Question 20Manage Actions and Workflows

    How do you secure GitHub Actions workflows?

    ANo security needed
    BPin actions to SHA (not tags), use least-privilege GITHUB_TOKEN permissions, avoid script injection in expressions, use environments with protection rules, and audit third-party actions
    CUse latest always
    DTrust all actions

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  21. Question 21Consume Workflows

    How do you pass data between jobs in a workflow?

    AShared filesystem
    BUsing job outputs and the 'needs' keyword, or artifacts
    CGlobal environment variables
    DDirect function calls

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  22. Question 22Author and Maintain Workflows

    How do you share data between jobs in a workflow?

    AJobs automatically share all data
    BUse artifacts (upload/download-artifact), workflow outputs, or caching for dependencies — jobs run on separate runners and don't share filesystems
    CShared filesystem
    DGlobal variables

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz
  23. Question 23Consume Workflows

    What are composite run steps in reusable workflows?

    ACannot combine
    BReusable workflows can contain multiple jobs with their own steps, and composite actions can combine run commands and action references into a single reusable unit
    COnly one step allowed
    DOnly shell commands

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start GH-ACTIONS Quiz

Key Workflow Syntax Concepts for GH-ACTIONS

workflowyamltriggeronjobsstepsactionsexpressions

GH-ACTIONS Workflow Syntax Exam Tips

Workflow Syntax & Structure questions in GH-ACTIONS are typically scenario-based. Focus on service-level decision making aligned to official exam objectives. Priority concepts: workflow, yaml, trigger, on, jobs, steps.

What GH-ACTIONS Expects

  • Anchor your answer in select the most practical, secure, and scalable answer for the stated scenario.
  • Workflow Syntax scenarios for GH-ACTIONS are frequently mapped to Domain 1 (20–25%), Domain 2 (15–20%), so read the objective carefully before picking controls or architecture.
  • Expect multi-topic scenarios where Workflow Syntax interacts with workflows, security, collaboration, or automation patterns rather than appearing as an isolated question.
  • When two options are both technically valid, prefer the choice that best aligns with the exam's operational scope (Intermediate) and vendor best practices.

High-Value Workflow Syntax Concepts

  • Know the core Workflow Syntax building blocks cold: workflow, yaml, trigger, on.
  • Review the edge-case features and limits for jobs, steps; these details are commonly used to differentiate answer choices.
  • Practice service-integration reasoning: how Workflow Syntax pairs with CI/CD, Custom Actions in real deployment patterns.
  • For GH-ACTIONS, explain why the chosen Workflow Syntax design meets reliability, security, and cost expectations better than the alternatives.

Common GH-ACTIONS Traps

  • Watch for answers that partially solve the requirement but miss operational constraints.
  • Questions in Author and Manage Workflows often include distractors that look correct for Workflow Syntax but violate access control, branch protection, or workflow requirements.
  • Avoid picking options purely by feature name; validate data path, failure handling, and governance impact before answering.
  • If the prompt hints at automation or repeatability, eliminate manual-only operational answers first.

Fast Review Checklist

  • Can you compare at least two Workflow Syntax implementation paths and justify which one best fits the scenario?
  • Can you map the chosen answer back to Author and Manage Workflows (20–25%) outcomes for GH-ACTIONS?
  • Can you explain security and access boundaries for Workflow Syntax without relying on default-open assumptions?
  • Can you describe how Workflow Syntax integrates with CI/CD and Custom Actions during failure, scaling, and monitoring events?

Exam Domains Covering Workflow Syntax

Related Resources

More GH-ACTIONS Study Resources