I’m trying to setting up a yml for Github Actions to run a pytest before merging pull request to main branch.
So, what I wanna do is:
- Click on the “Merge pull request” button
- Github Action will automatically run pytest
- If the tests pass, cancel merge
I read the document of merge_group but not sure if I’m understanding it correctly.
My yml file is currently like:
on:
pull_request:
branches:
- main
merge_group:
types: [checks_requested]
but does this do the trick?
New contributor
Toshi Tan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.