PHPackages                             bitexpert/captainhook-validateauthor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bitexpert/captainhook-validateauthor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bitexpert/captainhook-validateauthor
====================================

Captain Hook Plugin to check if commit author is valid (e.g. email in whitelist)

v0.9.0(1y ago)765.3k—5%4Apache-2.0PHPPHP ^8.0.0|^8.1.0|^8.2.0CI failing

Since Apr 20Pushed 1y ago3 watchersCompare

[ Source](https://github.com/bitExpert/captainhook-validateauthor)[ Packagist](https://packagist.org/packages/bitexpert/captainhook-validateauthor)[ RSS](/packages/bitexpert-captainhook-validateauthor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (14)Versions (20)Used By (0)

bitexpert/captainhook-validateauthor
====================================

[](#bitexpertcaptainhook-validateauthor)

This package provides an action for [Captain Hook](https://github.com/CaptainHookPhp/captainhook) 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.

[![Build Status](https://github.com/bitExpert/captainhook-validateauthor/workflows/ci/badge.svg?branch=master)](https://github.com/bitExpert/captainhook-validateauthor/actions)[![Coverage Status](https://camo.githubusercontent.com/8852f14e829b9e5f3fb81fac505bf4e34b6bb5ac04236366cf122b9849b71b40/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6269744578706572742f6361707461696e686f6f6b2d76616c6964617465617574686f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bitExpert/captainhook-validateauthor?branch=master)[![Mastodon Follow](https://camo.githubusercontent.com/c2abd2d790b2fdf042e992e8872c59044086bdb16b119a61d8526d6238c3c2ba/68747470733a2f2f696d672e736869656c64732e696f2f6d6173746f646f6e2f666f6c6c6f772f3130393430383638313234363937323730303f646f6d61696e3d68747470733a2f2f726865696e6e65636b61722e736f6369616c)](https://rheinneckar.social/@bitexpert)

Installation
------------

[](#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
-----

[](#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](https://github.com/CaptainHookPhp/captainhook) will now check on every commit if author name and email match the defined regex. If not, the commit will be canceled.

Contribute
----------

[](#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?
-------------------

[](#want-to-contribute)

If you feel that you have something to share, then we’d love to have you. Check out [the contributing guide](CONTRIBUTING.md) to find out how, as well as what we expect from you.

License
-------

[](#license)

Captain Hook Validate Author Action is released under the Apache 2.0 license.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~272 days

Recently: every ~371 days

Total

9

Last Release

408d ago

PHP version history (5 changes)v0.1.0PHP ^7.2.0

v0.3.0PHP ^7.3.0|^8.0.0

v0.4.0PHP ^7.4.0|^8.0.0

v0.7.0PHP ^7.4.0|^8.0.0|^8.1.0

v0.8.0PHP ^8.0.0|^8.1.0|^8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1adf0ab660536efce10aeb97f0c90ec881110b64fbd23429fa945190df0def56?d=identicon)[shochdoerfer](/maintainers/shochdoerfer)

---

Top Contributors

[![shochdoerfer](https://avatars.githubusercontent.com/u/596449?v=4)](https://github.com/shochdoerfer "shochdoerfer (120 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![cmmata](https://avatars.githubusercontent.com/u/4223148?v=4)](https://github.com/cmmata "cmmata (3 commits)")[![aboks](https://avatars.githubusercontent.com/u/815524?v=4)](https://github.com/aboks "aboks (1 commits)")[![heiglandreas](https://avatars.githubusercontent.com/u/91998?v=4)](https://github.com/heiglandreas "heiglandreas (1 commits)")

---

Tags

captainhookgitgithookphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bitexpert-captainhook-validateauthor/health.svg)

```
[![Health](https://phpackages.com/badges/bitexpert-captainhook-validateauthor/health.svg)](https://phpackages.com/packages/bitexpert-captainhook-validateauthor)
```

###  Alternatives

[captainhook/plugin-composer

Composer-Plugin handling your git-hooks

201.9M169](/packages/captainhook-plugin-composer)[ramsey/devtools

A Composer plugin to aid PHP library and application development.

7134.7k26](/packages/ramsey-devtools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
