I am doing npm test when pull requests are raised using Github actions . Now if tests fails , I would like to add a message or at least reject the PR using actions.. How can i d
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