Run action when pull-request was created OR a new commit was pushed in this PR

I need to run unit tests when the pull-request was created OR a new commit was pushed in this PR.
If the tests fail, the merge should be blocked.
I tried to use on: [push, pull_request], but it works even when the pull request was not created

pull_request can be filtered to specific activity types:

https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request

Could you remove push and try using pull_request with the activity type of [created, synchronized] to see if that works?

Thanks! It works perfectly