On push trigger events, the workflow runs on all pushes to a repository branch. Is it possible to run on all pushes only if the repository branch is an opened pull request?
on:
push:
types: [pull_request]
...
On push trigger events, the workflow runs on all pushes to a repository branch. Is it possible to run on all pushes only if the repository branch is an opened pull request?
on:
push:
types: [pull_request]
...
Hi @jeff-hernandez, welcome to the GitHub Support Community! Workflows can only be triggered by the events listed on this page:
https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
pull_request
isn’t a valid type of push
event so this syntax won’t work. What you’re likely looking for is the synchronize
type of the pull_request
event. This will trigger your workflow each time the HEAD branch is updated in a pull request—i.e. when it’s pushed to.
on:
pull_request:
types: [synchronize]