CI trigger

What it is

A trigger is the condition that starts a pipeline/workflow run. In Azure Pipelines, trigger: (CI), pr: (pull request), and schedules: define what kicks off a run; in GitHub Actions, triggers are the events that fire a workflow.

Why it exists

CI should run automatically when relevant code changes — without a human pressing “run”. Triggers scope automation so builds fire only on the branches, paths, or schedule you care about, avoiding wasted minutes.

Key ideas

  • Azure Pipelines
    • trigger: — CI trigger; runs on push to matching branches (default: every branch). Branch/path filters narrow it.
    • pr: — pull-request trigger; runs when a PR targets matched branches.
    • schedules: — cron-based scheduled builds (cron:, branches:, always:).
    • trigger: none disables CI.
  • GitHub Actions
    • on: defines events — push, pull_request, schedule (cron), workflow_dispatch (manual), release, etc.
    • Branch/path/tag filters via branches:, paths:, tags:.
  • Triggers differ from conditions (condition:) which gate individual jobs/steps within an already-running pipeline.

Exam notes

  • Know the Azure Pipelines trigger: vs pr: keywords and that path filters reduce runs.
  • GitHub Actions on: [push, pull_request] shorthand vs full object form with filters.
  • workflow_dispatch = manual trigger in GitHub Actions (no GitHub equivalent built-in in Azure Pipelines classic CI; classic has manual run).

pipeline-yaml · azure-pipelines · github-actions

📘 Source: Microsoft Learn — Ci Trigger