What activity types does `pull_request` trigger on by default, and how do you add more?
IntermediateConceptTriggers & Events
Answer
By default: opened, synchronize (new commits) and reopened. Add types explicitly when needed, for example to re-run checks when a label is added or a draft becomes ready:
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
Then skip drafts with if: github.event.pull_request.draft == false. Note closed is how you detect a merge: if: github.event.pull_request.merged == true.
More on Triggers & Events
How do you trigger a workflow on pushes to `main` and on PRs that target `main`?BeginnerHow do `branches` and `branches-ignore` filters work with globs?BeginnerHow do path filters work, and what are their limits?AdvancedHow do you trigger only on version tags, and what is the gotcha with pushing many tags?IntermediateWhat is `workflow_dispatch`, and what input types does it support?BeginnerWhy does `github.event.inputs.dry_run == true` never match, while `inputs.dry_run` works?Intermediate