ci: Avoid duplicate runs of workflows
GitHub Actions CI is configured to run on push and pull_request events on the main branch. This causes duplicated runs of the workflows when a PR gets merged. We should avoid duplicating workflow runs in such scenarios.
This isn't the right thing to do. Why would you want to accomplish such a behavior?
I can recall quite a few moments when CI on PR passed, and once PR got merged, it failed for various reasons (the PR branch was missing some commits from the main, etc.).
A good example is tests and test coverage. You generally want to run tests and upload test coverage on pull_request to measure changes in coverage with changes from PR. Once merged, you want to run it again to measure and update the overall test coverage of the project.
But if you want to accomplish this thing. The only option is to run workflows only on pull_request or push events.
I think @siteshwar meant the case where both branches point to the same commit object, which is the most common case in this project. I fully agree that it makes sense to re-run the tests if main refers to a different commit (or even a different tree) after the merge.
@siteshwar Do you have any updates?
@siteshwar Ping?
@siteshwar Ping?
Sorry, I have not taken a look at this issue and its not my priority for now.