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. Each question includes the full answer and a detailed explanation to help you understand the concepts.
- Question 1Author and Manage Workflows
What GitHub Actions context variable contains the name of the branch that triggered a push workflow?
Show Answer & Explanation
Correct Answer: BExplanation:${{ github.ref }} contains the full ref, e.g., refs/heads/main. For branch name only, use github.ref_name.
- Question 2Author and Manage Workflows
In a GitHub Actions workflow YAML file, what key defines the event that triggers the workflow?
Show Answer & Explanation
Correct Answer: BExplanation:The on: key specifies the event(s) that trigger the workflow, e.g., on: push, on: pull_request, or on: schedule.
- Question 3Author and Manage Workflows
By default, how do jobs in a GitHub Actions workflow run?
Show Answer & Explanation
Correct Answer: BExplanation:Jobs run in parallel by default. The needs: keyword creates dependencies to run them sequentially.
- Question 4Author and Manage Workflows
Which trigger allows a workflow to be started manually from the GitHub UI or via the API?
Show Answer & Explanation
Correct Answer: CExplanation:workflow_dispatch allows manual triggering from the GitHub UI or REST API, optionally accepting input parameters.
- Question 5Author and Manage Workflows
What is the smallest unit of work in a GitHub Actions workflow?
Show Answer & Explanation
Correct Answer: CExplanation:Steps are the individual tasks within a job. Each step runs a shell command (run:) or uses an action (uses:).
- Question 6Author and Manage Workflows
What file format is used to write GitHub Actions workflows?
Show Answer & Explanation
Correct Answer: CExplanation:GitHub Actions workflows are written in YAML files stored in .github/workflows/ in the repository.
- Question 7Author and Manage Workflows
Where must GitHub Actions workflow files be placed in a repository?
Show Answer & Explanation
Correct Answer: BExplanation:Workflow files must be in the .github/workflows/ directory at the root of the repository.
- Question 8Consume and Troubleshoot Workflows
How do you call a reusable workflow from another workflow in GitHub Actions?
Show Answer & Explanation
Correct Answer: AExplanation:You reference a reusable workflow from a job with uses: pointing to the workflow file path. The reusable workflow must use the workflow_call trigger.
- Question 9Author and Manage Workflows
Which action caches dependencies in GitHub Actions to speed up workflows?
Show Answer & Explanation
Correct Answer: BExplanation:actions/cache saves and restores files (e.g., node_modules, pip packages) between runs to reduce download times.
- Question 10Manage GitHub Actions for the Enterprise
How do you target a specific self-hosted runner in a GitHub Actions workflow?
Show Answer & Explanation
Correct Answer: BExplanation:Self-hosted runners have labels. You target them in a job with runs-on: [self-hosted, linux, arm64] for example.
- Question 11Secure and Optimize Automation
In GitHub Actions, how do you reference an encrypted secret named API_KEY in a workflow step?
Show Answer & Explanation
Correct Answer: BExplanation:Encrypted secrets are accessed with the secrets context: ${{ secrets.SECRET_NAME }}. They are never exposed in logs.
- Question 12Author and Maintain Workflows
Where must GitHub Actions workflow files be stored?
Show Answer & Explanation
Correct Answer: BExplanation:Workflow YAML files must be in the .github/workflows/ directory to be discovered and executed by GitHub Actions.
- Question 13Author and Maintain Workflows
Which keyword defines the events that trigger a workflow?
Show Answer & Explanation
Correct Answer: CExplanation:The 'on' keyword specifies which events (push, pull_request, schedule, workflow_dispatch, etc.) trigger the workflow execution.
- Question 14Author and Maintain Workflows
What is the purpose of 'workflow_dispatch' trigger?
Show Answer & Explanation
Correct Answer: BExplanation:workflow_dispatch enables manual workflow execution from the Actions tab or REST API, with support for custom input parameters that can be used in the workflow.
- Question 15Consume Workflows
How do you debug a failing GitHub Actions workflow?
Show Answer & Explanation
Correct Answer: BExplanation:Debug strategies: set ACTIONS_STEP_DEBUG=true secret for verbose logs, add 'echo' statements, use tmate action for SSH into runner, check step annotations, and use act for local testing.
- Question 16Author and Maintain Workflows
How do you handle secrets in GitHub Actions workflows?
Show Answer & Explanation
Correct Answer: BExplanation:Secrets management: store encrypted in Settings (repo, org, or environment level). Reference: ${{ secrets.MY_SECRET }}. Auto-masked: if printed to log, shown as ***. Never echo secrets for debugging. Rotate regularly. For cloud auth: prefer OIDC over stored credentials.
- Question 17Consume Workflows
What are GitHub Actions starter workflows?
Show Answer & Explanation
Correct Answer: BExplanation:Starter workflows: templates in .github/workflows/ when you click 'New workflow'. GitHub provides: language-specific CI (Node.js, Python, Java), deployment (Azure, AWS, GCP), security (CodeQL), and custom org starters. Org: create in .github repo's workflow-templates/ directory.
- Question 18Manage Actions and Workflows
How do you debug failing GitHub Actions workflows?
Show Answer & Explanation
Correct Answer: BExplanation:Debugging: enable step debug logging (ACTIONS_STEP_DEBUG=true secret), runner diagnostic logging (ACTIONS_RUNNER_DEBUG=true), review logs per step in Actions tab, add diagnostic steps (env, ls, cat), use 'act' locally, and tmate/mxschmitt/action-tmate for interactive debugging.
- Question 19Author and Maintain Workflows
What are expressions and functions in GitHub Actions?
Show Answer & Explanation
Correct Answer: BExplanation:Expressions: ${{ expression }}. Contexts: github (event data), env, job, steps, runner, secrets, inputs, matrix. Functions: contains(), startsWith(), endsWith(), format(), join(), toJSON(), fromJSON(), hashFiles(), success(), failure(), cancelled(), always(). Operators: ==, !=, &&, ||, !.
- Question 20Manage Actions and Workflows
How do you secure GitHub Actions workflows?
Show Answer & Explanation
Correct Answer: BExplanation:Security practices: pin to SHA (uses: actions/checkout@abc123def), least privilege (permissions: read-all), avoid script injection (don't use ${{ github.event.issue.title }} in run:), use environments (required reviewers for prod), Dependabot for action updates, restrict fork PR permissions, and OpenSSF Scorecard for action assessment.
- Question 21Consume Workflows
How do you pass data between jobs in a workflow?
Show Answer & Explanation
Correct Answer: BExplanation:Jobs run on separate runners, so data passes via job outputs (needs.<job>.outputs.<name>) for small values or upload/download-artifact actions for files.
- Question 22Author and Maintain Workflows
How do you share data between jobs in a workflow?
Show Answer & Explanation
Correct Answer: BExplanation:Jobs run on separate runners. Share via: artifacts (upload in job A, download in job B), job outputs ('outputs' key + needs dependency), and cache (actions/cache for dependencies). Each method has different persistence and use cases.
- Question 23Consume Workflows
What are composite run steps in reusable workflows?
Show Answer & Explanation
Correct Answer: BExplanation:Composite actions vs reusable workflows: Composite actions: combine steps (run + uses) into one action, referenced like any action (uses: ./my-action). Reusable workflows: full workflow with jobs, called via workflow_call (uses: org/repo/.github/workflows/ci.yml@main). Key differences: composite runs in caller's job, reusable runs as separate jobs. Choose composite for: step-level reuse. Choose reusable workflows for: job-level reuse with separate runners.
Key Workflow Syntax Concepts for GH-ACTIONS
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 (40%), so read the objective carefully before picking controls or architecture.
- Expect multi-service scenarios where Workflow Syntax interacts with IAM, networking, storage, or observability patterns rather than appearing as an isolated service question.
- When two options are both technically valid, prefer the choice that best aligns with the exam's operational scope (Intermediate) and managed-service 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 Maintain Workflows often include distractors that look correct for Workflow Syntax but violate least-privilege, durability, or availability 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 Maintain Workflows (40%) 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?