I am doing npm
test when pull requests are raised using Github actions.
- Now if tests fail,
- I would like to add a message,
- Or at least, reject the PR using actions.
How can I do this?
I am doing npm
test when pull requests are raised using Github actions.
How can I do this?
I assume you have an on: pull_request
workflow that runs npm test
. This should automatically create a GitHub Check on the pull request that will fail if your tests fail. The best way to "reject" the pull request is to prevent it from being merged unless the tests pass. You can do this by turning on a setting in your repository to "Require status checks to pass before merging," and selecting your workflow as required.
You can find this setting under your repository's Settings > Branches.
There are further details about these settings in the documentation. https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks
in status checks bar, type the action name you have defined in your workflow yml file, then merge will check your defined workflow action