Reducing CI/CD Duplication with Reusable GitHub Actions Workflows
Your GitHub organization has multiple repositories that share common CI/CD workflows. You want to centralize these workflows to reduce duplication. Which TWO approaches are valid?
Quick Answer
Reusable GitHub Actions workflows, referenced with the uses: keyword pointing at a central repository's workflow file, let an organization define common CI/CD logic once and call it from every repository that needs it — the actual mechanism for centralizing workflows, as opposed to a template repository, which only copies files at creation time and doesn't stay in sync afterward.
⚠ Common exam trap
A common mix-up: candidates confuse Git submodules or template repositories as valid methods for sharing live, updatable workflows, when in fact only reusable workflows (Option A) and template repositories (Option C, for initial setup) are officially supported approaches for centralizing CI/CD workflows in GitHub Actions.
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 reusable workflows in a central repository and use the 'uses' keyword in each repository's workflow to reference them.
GitHub Actions supports reusable workflows that can be stored in a central repository and referenced from other repositories using the 'uses' keyword with the syntax 'owner/repo/.github/workflows/workflow.yml@ref'. This allows teams to define common CI/CD logic once and invoke it across multiple repositories, reducing duplication and simplifying maintenance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Create reusable workflows in a central repository and use the 'uses' keyword in each repository's workflow to reference them.
Why this is correct
Reusable workflows allow centralized maintenance.
- ✗
Store the workflows in a central repository and use Git submodules to include them in each repository.
Why it's wrong here
Git submodules are for code, not for workflows.
- ✓
Create a template repository containing the workflows and use it as a template for new repositories.
Why this is correct
Template repositories allow copying workflows into new repos, but updates are not synced automatically.
- ✗
Use branch protection rules to enforce that all workflows must be reviewed by a central team.
Why it's wrong here
Branch protection rules do not centralize workflow definitions.
- ✗
Publish the workflows as a GitHub Actions workflow library and install it in each repository.
Why it's wrong here
There is no 'workflow library' feature in GitHub.
Go deeper
Related to this question
Learn chapter
Managing Infrastructure as Code Using Azure
Key term
Repository
A repository is a central storage location where software packages, code, or configuration files are kept, managed, and distributed for use by IT systems.
Key term
GitHub
GitHub is a cloud-based platform for storing, tracking, and collaborating on code using Git version control.
About these practice questions
This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AZ-400
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Your organization has multiple GitHub repositories that use shared workflows. You want to centrally manage these workflows and ensure they are always up to date. What is the recommended approach?
hard- ✓ A.Create a central repository with reusable workflows and reference them using the 'uses' keyword in your workflows.
- B.Use the GitHub API to push workflow files to each repository on a schedule.
- C.Download the workflows from a central blob storage and include them as inline scripts.
- D.Store the workflows in a separate repository and use Git submodules to include them.
Why A: The recommended approach is to create a central repository with reusable workflows and reference them using the 'uses' keyword. This is a native GitHub Actions feature that allows you to define shared workflow files in one repository and call them from any other repository in your organization. This ensures all workflows stay up to date centrally. The other options are not recommended: B uses API scheduling which is unnecessary and harder to manage; C downloads workflows from blob storage as inline scripts which loses the benefits of shared workflow versioning; D uses Git submodules which are designed for code dependencies and do not integrate well with GitHub Actions workflow execution.
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.