on

The top-level workflow key that lists which events start the workflow, with optional filters for each.

In more detail

It can be a single event, a list, or a mapping where each event has filters such as branches, tags and paths. Whatever wakes the workflow, the jobs are the same; the run only differs in the event it carries.

Example

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

Related terms

Taught in

References

Certification courses