I'm setting up Github actions for a few of my projects. The flow I'd like to achieve is:
- A developer clicks on the "Merge pull request" button
- A Github action testing workflow will take place
- If the tests pass - The merge is executed
The reason for this kind of flow, is I wouldn't like the tests to run on each commit pushed to the branch. I want the flow to run only when trying to merge.
My question is: Is there a way to manually execute a workflow only when trying / wanting to merge, and making sure the branch can be merged into master if and only if the tests have passed?