As far as I can tell
on: [pull_request] is not the right thing, because that triggers when doing various other actions on a pull request, such as requesting a review or closing it.
on: [push] combined with
if: github.event_name == 'pull_request' doesn’t seem to work. If I understand correctly, this is because they can’t both be true at the same time.
I’m starting to think I might’ve missed something, because there are heaps of people which seem to say that
on: [pull_request] means “when pushing to a pull request branch”, but I can’t reconcile that with the documentation. I thought maybe the
synchronize activity type might be related to pushes, but the official documentation doesn’t seem to have any details. This article seems to corroborate the common usage, but that’s the only one I could find.
This is related to another question (as a new user I’m not allowed to add any more links to this post) – basically I’m trying to figure out how to run jobs only when pushing to
- a branch
- for which there exists a pull request
- which is open and
- which is not a draft.