Pull requests trigger duplicate checks for both [push] and [pull_request]


I’ve noticed some recent repos I’ve setup with GitHub Actions seem to be duplicating work on pull requests and running/logging the tests for both the push and pull_request actions. What’s weird though is I’ve scanned through a few other repos (that aren’t mine) that seem to be configured in a similar way that do not have this issue?

You can see an example of it here and in the following screenshot.

Definitely possible I goofed my workflow config as well. :sweat_smile:

@rdmurphy ,

This is a correct behavior, not an issue. In the Checks of a PR, it will list all the jobs from the workflows run on the push  event and the  pull_request  event based on the latest commit in the HEAD branch (source branch of the PR). Currently, we have no methods to only list the the jobs run on the pull_request  event.

Because you configure your “Node CI” workflow runs on both push and  pull_request , when you push commit the workflow will be triggered, and when the PR is Open , this workflow also will be triggered by the pull_request. So on the checks list of your PR, it will list two similar checks triggered by different events ( push and  pull_request ).

1 Like

@rdmurphy ,

Is my previous helpful to your?

If you have any other question about this ticket, feel free to tell us.

Ah — so maybe what I’m after is just [push]? That would continue logging the latest check of a push of that branch in the pull request? I think that’s all I truly care about, I currently have nothing special expected to happen on a pull.

@rdmurphy ,

To avoid the duplicate checks being generated on the same PR, you can try to just set pull_request event or push event for the workflow. Or set branches filter on them.

1 Like

Thank you for clarifying! This makes sense now. I’ll accept your original response as the answer — I think it summarizes it well.