What are pipeline triggers?

BeginnerConceptCI/CD practices
Answer

In one line: Triggers are the events that start a pipeline automatically — such as a push, a pull request, a schedule, a tag or a manual button.

Common triggers:

  1. Push — runs when code is pushed to a branch (for example build and deploy on push to main).
  2. Pull request / merge request — runs CI checks on proposed changes before merging.
  3. Tag / release — runs a release pipeline when a tag like v1.4.0 is created.
  4. Schedule (cron) — nightly builds, nightly security scans, weekly dependency checks.
  5. Manual — a person starts it, often with inputs (environment, version). In GitHub Actions: workflow_dispatch.
  6. Upstream pipeline — one pipeline finishing triggers another (for example a shared library build triggers the apps that use it).
  7. Webhook / API / external event — a new image in a registry, a ticket approved, or a call from another system.
  8. Path filters — only run when certain files change (useful in monorepos).

Example (GitHub Actions):

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]
    paths: ["services/orders/**"]
  schedule:
    - cron: "0 2 * * *"     # every night at 02:00 UTC
  workflow_dispatch:
    inputs:
      environment:
        type: choice
        options: [staging, production]

Choosing triggers well:

  • PRs → fast checks (build, unit tests, lint, scans).
  • Merge to main → full pipeline and deploy to dev/staging.
  • Tags or approvals → production.
  • Nightly → slow tests, full security scans.

Tip for interviews: mention path filters for monorepos and the difference between PR checks and post-merge deployment pipelines.

All DevOps Fundamentals questions

More on CI/CD practices