Bitzu

AZ-400 ยท Pipeline foundations

Pipeline trigger rules

CI, PR, scheduled and pipeline-resource triggers in Azure Pipelines; on: push, pull_request, schedule, workflow_dispatch, workflow_run in GitHub Actions; branch, tag and path filters; batching and skipping CI.

Key points

  • Azure Pipelines trigger (CI on push): branches, tags, paths include/exclude; batch: true = one run for queued changes; trigger: none disables CI.
  • [skip ci] in a commit message skips CI.
  • GitHub pull_request defaults: opened, synchronize, reopened.
  • schedule (cron, default branch only), workflow_dispatch (manual), workflow_run (after another workflow, any result unless conclusion is checked).
  • Branches and paths must both match.

Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/trigger?view=azure-pipelines

Practice questions

Single choice

If a GitHub Actions workflow uses on: pull_request with no types listed, which activity types start it?

  1. opened, synchronize and reopened
  2. opened and closed only
  3. every activity type, including labeled
  4. synchronize only
Show answer

Answer: A. opened, synchronize and reopened

The defaults are opened, synchronize and reopened. Closed and labeled need to be listed explicitly.

Select all that apply

Which GitHub Actions events can start a workflow without a push or a pull request?

  1. schedule
  2. workflow_dispatch
  3. workflow_run
  4. push
  5. pull_request
Show answer

Answer: A. schedule, B. workflow_dispatch, C. workflow_run

schedule (cron), workflow_dispatch (manual) and workflow_run (after another workflow) all start runs independently of code events. push and pull_request are the code events.

True or false

A GitHub Actions schedule trigger runs the workflow file from whichever branch you last pushed it to.

Show answer

Answer: False

False. Scheduled workflows run only from the latest commit on the default branch.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module