Courseiva
Design and implement build and release pipelinesmediumMultiple ChoiceObjective-mapped

AZ-400 Practice Question: Design and implement build and release pipelines

Your team uses GitHub Actions for CI/CD. You want to reuse a workflow across multiple repositories without duplicating code. Which approach should you use?

⚠ Common exam trap

Test-takers frequently confuse reusable workflows with composite actions or workflow templates. Reusable workflows allow you to reference a complete workflow (jobs/steps) from a central repository, but they do not define their own triggers; they are invoked via `workflow_call` from a caller workflow.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Create a reusable workflow in a central repository and reference it using 'uses: owner/repo/.github/workflows/workflow.yml@ref'.

GitHub Actions supports reusable workflows that allow you to define a workflow in a central repository and reference it from other repositories using the 'uses' syntax with the format 'owner/repo/.github/workflows/workflow.yml@ref'. This eliminates code duplication while maintaining a single source of truth for the workflow logic, and the referenced workflow can be triggered by events in the caller repository.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Store the workflow in a shared repository and use environment secrets to share credentials.

    Why it's wrong here

    Storing a workflow in a shared repository does not make it callable from other repositories, and environment secrets are scoped to a specific environment/repository—they only store sensitive values, not workflow logic. GitHub's reusable workflow mechanism is the supported way to invoke a workflow defined in another repository, so this approach cannot achieve workflow reuse across repos.

  • Create a reusable workflow in a central repository and reference it using 'uses: owner/repo/.github/workflows/workflow.yml@ref'.

    Why this is correct

    A reusable workflow is a YAML file in another repository that declares `on: workflow_call`, and it is referenced from a calling workflow using `uses: owner/repo/.github/workflows/workflow.yml@ref` where `ref` can be a branch, tag, or SHA. This allows centralized management of CI/CD logic, versioned reuse, and parameterized inputs/secrets across multiple repositories within your organization.

  • Create a composite action and reference it from each workflow.

    Why it's wrong here

    A composite action packages a series of steps for reuse inside a single job, but it does not have its own triggers or job-level structure, so it cannot replace an entire multi-job CI/CD workflow. Each workflow would still need to define the job(s), checkout, and orchestration around the action, meaning the workflow itself is not reused—only the steps are.

  • Create a workflow template in the organization's .github repository.

    Why it's wrong here

    Workflow templates in the organization's `.github` repository are only shown in the 'new workflow' creation UI as starting points for developers to copy into their own repositories. Once a workflow is created from a template, it becomes a static copy—subsequent changes to the template do not propagate to existing workflows, so this is not a live reuse mechanism.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.