thehanimo / pr-title-checker

An action to automatically check if pull request titles conform to Contribution Guidelines
MIT License
106 stars 36 forks source link

why not make the CI fail? #1

Closed camilamacedo86 closed 3 years ago

camilamacedo86 commented 3 years ago

Could it have an option for we make the ci fail instead of just add the label?

thehanimo commented 3 years ago

Yup that's definitely possible. We can add a parameter alwaysPassCI just in case people don't want tests failing only because of the title format. Would you like to take it up?

camilamacedo86 commented 3 years ago

I have no idea how it works. However, shows that it would be an if in https://github.com/thehanimo/pr-title-checker/blob/master/dist/index.js#L221 which should exit with 1. Also, we would need a new release after that.

thehanimo commented 3 years ago

Ideally, you'd only want to make changes to https://github.com/thehanimo/pr-title-checker/blob/master/index.js. The dist folder is generated by the prepare script. We can probably have alwaysPassCI added as a key in the CHECKS object. Then, we can add a parameter to the addLabel function which takes in alwaysPassCI and if false, run core.setFailed("Fail CI test") just after core.info("Adding...") (inside addLabel).

thehanimo commented 3 years ago

Hey @camilamacedo86! I just released a new version (v1.1) which addresses this issue. Hope it helps you manage pull requests more efficiently!

Thank you so much!