Skip to content

CICD-004 · Select pull request activity types ​

Encyclopedia · Events and triggers · All snippets

Previous · CICD-003 · Next · CICD-005

1. Where it fits ​

  • Placement .github/workflows/ci.yml, at workflow level, or within jobs for a named job mapping.
  • Prerequisites workflow on an example repository with main as default.
  • Platforms github-actions, gitea-actions.

2. Copy the snippet ​

yaml
on:
  pull_request:
    types: [opened, synchronize, reopened]

3. How it works ​

A pull request can emit several activity types. synchronize is emitted when its head changes, so adding it keeps validation current after the initial open.

4. Verify the result ​

Push another commit to the PR and inspect the synchronize event.

Watch for. Place event filters at workflow scope and test an event that should run and an event that should be skipped.

Validation syntax-validated (YAML parse). Status definitions.