https://github.com/bitexpert/captainhook-rejectpush
Captain Hook Plugin to reject a remote push when certain commit Ids are found in history
https://github.com/bitexpert/captainhook-rejectpush
captainhook git githook php
Last synced: about 1 year ago
JSON representation
Captain Hook Plugin to reject a remote push when certain commit Ids are found in history
- Host: GitHub
- URL: https://github.com/bitexpert/captainhook-rejectpush
- Owner: bitExpert
- License: apache-2.0
- Created: 2019-02-17T09:20:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T09:10:06.000Z (about 2 years ago)
- Last Synced: 2025-04-14T07:07:19.002Z (about 1 year ago)
- Topics: captainhook, git, githook, php
- Language: PHP
- Homepage:
- Size: 238 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# bitexpert/captainhook-rejectpush
This package provides an action for [Captain Hook](https://github.com/CaptainHookPhp/captainhook)
which will reject a push to a remote when configured commit Ids are found in the Git history.
[](https://github.com/bitExpert/captainhook-rejectpush/actions)
[](https://coveralls.io/github/bitExpert/captainhook-rejectpush?branch=master)
[](https://rheinneckar.social/@bitexpert)
## Installation
The preferred way of installing `bitexpert/captainhook-rejectpush` is through Composer.
You can add `bitexpert/captainhook-rejectpush` as a dev dependency, as follows:
```
composer.phar require --dev bitexpert/captainhook-rejectpush
```
## Usage
Add the following code to your `captainhook.json` configuration file:
```
{
"pre-push": {
"enabled": true,
"actions": [
{
"action": "\\bitExpert\\CaptainHook\\RejectPush\\RejectPushAction",
"options": {
"my-origin": [
"cc9d54f"
],
"other-remote": [
"41ce954"
]
}
}
]
}
}
```
[Captain Hook](https://github.com/CaptainHookPhp/captainhook) will now check
on every push if one of the defined commit Ids is part of the push. If so, it
will cancel the push.
## 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](CONTRIBUTING.md) to find out how, as well as what we expect from you.
## License
Captain Hook Reject Push Action is released under the Apache 2.0 license.