Github action to ensure that test are added to a project for new features or bug fixes.
By default, when a pull request is opened and is name contains
feat
orfix
, the action will fail if the list of files changes does not match
With my colleague Florent Dubost, we try to instill in our development teams the need to always try to implement automated tests in the Pull Requests on which they modify the product of our tools.
This is part of our "team rules" that we try to respect.
As we presented in the article in french "How not to throw away a frontend application every two years?, we always try to automate our team rules so that they don't rely on people who are then the guarantor of the respect of these rules.
Also explained in this video conference in french.
With my colleague Mickaël Alves, we took advantage of an R&D day to implement the rule "Always add/modify tests when we make a fix or develop a new feature" that Florent was making sure we respected but with a Github action.
This is why we named the project flo-du-bot
, linked to the name of the person who inspired this idea.
This action allows you to include a title check of a pull request automatically. This action only works on pull_request
events.
Add this action on your pull request event workflows.
steps:
- uses: Slashgear/flo-du-bot@v1.0.0
with:
prTitlePattern: "(feat|fix)" # Regexp the title should match. (default)
testFileExtensionPattern: "(spec.js|int.js|.feature|test.js)" # Regexp of modified files extensions (default)
sourceFilePattern: "src/.*.(js|ts)" # Regexp of source files edition detection. (default)
reviewEvent: "REQUEST_CHANGES" # Type of event triggered by the bot in the pullRequest (default) other values: COMMENT for review status comment, NONE if you don't want it to touch your PR reviews
token: $ # Github token used (you could pass ${{ secrets.GITHUB_TOKEN }})
👤 Slashgear
- Website: https://blog.slashgear.dev/
- Twitter: @Slashgear_
- Github: @Slashgear
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Slashgear.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator