Courseiva
Design and implement build and release pipelinesmediumMultiple ChoiceObjective-mapped

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

Exhibit

{
  "triggers": ["main"],
  "pool": {
    "vmImage": "ubuntu-latest"
  },
  "steps": [
    {
      "script": "echo Hello, world!"
    }
  ]
}

Refer to the exhibit. You have this GitHub Actions workflow YAML. The workflow does not trigger when you push to the main branch. What is the most likely issue?

⚠ Common exam trap

The trap here is that candidates familiar with Azure Pipelines might choose option D, thinking `triggers` is a misspelling of `trigger`, but GitHub Actions requires `on`, not `trigger`.

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

The correct keyword is 'on', not 'triggers'.

GitHub Actions workflows use the `on` keyword to define triggers, not `triggers`. The YAML snippet incorrectly uses `triggers`, which is not a valid key in GitHub Actions syntax; the workflow engine ignores it, so no push event on `main` will start the workflow. This is a common syntax error where the candidate confuses Azure Pipelines (which uses `trigger`) with GitHub Actions (which uses `on`).

Answer analysis

Option-by-option breakdown

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

  • The branch name should be in a list under 'branches' inside 'push'.

    Why it's wrong here

    In GitHub Actions, branch filtering for a push event belongs under the top-level `on` key as `on.push.branches`, which is an array of branch name patterns. However, the exhibit's root issue is that it uses `triggers` instead of `on`; simply placing `branches` under `push` will not fix the invalid workflow syntax.

  • The 'vmImage' should be 'windows-latest' for scripts.

    Why it's wrong here

    The `vmImage` setting selects the hosted runner operating system, and `ubuntu-latest` fully supports running shell scripts, including both bash and PowerShell Core. Changing to `windows-latest` is unnecessary and would not address the real problem: the use of the invalid top-level `triggers` key instead of `on`.

  • The correct keyword is 'on', not 'triggers'.

    Why this is correct

    GitHub Actions uses the top-level `on` key to define the events that trigger a workflow, such as `push` or `pull_request`. The exhibit incorrectly uses `triggers`, which is not a recognized key in GitHub Actions syntax, causing the workflow to be invalid or never run.

  • The 'triggers' keyword is misspelled; it should be 'trigger'.

    Why it's wrong here

    The correct keyword is `on`, not `trigger`; `trigger` is not a valid top-level key in GitHub Actions, which uses `on` to map event names to their configurations. Changing `triggers` to `trigger` would still leave the workflow invalid because GitHub Actions does not recognize that keyword.

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 →

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.