Pull_request vs push events

I have a workflow that should be triggered on both push and pull_request events:

on:
  push:
    branches-ignore:
      - "master"
      - "deploy-staging"
      - "deploy-production"
      - "deploy-loadtests"
  pull_request:

When I have a PR open and I push to that branch, I see that the push event is being triggered (verified by echo’ing the event in the workflow: run: echo "Event triggered by ${{ github.event_name }}") but the pull_request doesn’t fire. My understanding is by default the pull_request should fire when a PR is opened/closed/ and synchronized, i.e. commits are pushed, which is my case, but I don’t see the event triggering.

Is the workflow file present in the PR branches, configured for both events?

yes, it is present in the branch and configure for both events with the “on” syntax as above.

In that case, it might actually be a bug. You can try to rename the workflow file and possibly change the top level name: attribute as well?

@alexibz,

Make sure the workflow file is existing on the head branch (source branch) of the PR, and you push commits to the head branch.

If possible, you can share your repository with us, so that we can check more details of the PR and the workflow file to analyze the root cause.

Hi @brightran, thank you for the suggestions. I think I’ve figured it out. The repo in question is private and has certain settings, and I believe that the pull_request action was disabled in the settings, thus I it wasn’t being triggered.