bitexpert / captainhook-validateauthor
Captain Hook Plugin to check if commit author is valid (e.g. email in whitelist)
Installs: 40 872
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 4
Open Issues: 0
Requires
- php: ^8.0.0|^8.1.0|^8.2.0
- captainhook/captainhook: ^5.12.0
Requires (Dev)
- bitexpert/captainhook-infection: ^0.7.0
- captainhook/plugin-composer: ^5.3.3
- infection/infection: ^0.26.16
- madewithlove/license-checker: ^1.3
- phly/keep-a-changelog: ^2.12.1
- phpstan/extension-installer: ^1.2.0
- phpstan/phpstan: ^1.9.4
- phpstan/phpstan-phpunit: ^1.3.3
- phpstan/phpstan-strict-rules: ^1.4.4
- phpunit/phpunit: ^9.5.27
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.7.1
This package is auto-updated.
Last update: 2024-12-06 10:30:03 UTC
README
This package provides an action for Captain Hook which will reject a commit when author name or email does not match a regex defined in the captainhook.json
configuration file. Use this action if you want to make sure that your private email address does not end up in your companies' git repositories.
Installation
The preferred way of installing bitexpert/captainhook-validateauthor
is through Composer.
You can add bitexpert/captainhook-validateauthor
as a dev dependency, as follows:
composer.phar require --dev bitexpert/captainhook-validateauthor
Usage
Add the following code to your captainhook.json
configuration file:
{
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\bitExpert\\CaptainHook\\ValidateAuthor\\ValidateAuthorAction",
"options": {
"name": "/^[A-Za-z0-09]+$/",
"email": "/@example.com$/"
}
}
]
}
}
Captain Hook will now check on every commit if author name and email match the defined regex. If not, the commit will be canceled.
Contribute
Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.
Want To Contribute?
If you feel that you have something to share, then we’d love to have you. Check out the contributing guide to find out how, as well as what we expect from you.
License
Captain Hook Validate Author Action is released under the Apache 2.0 license.