itzbund/captainhook-hooks

v1.0.1 2024-03-01 08:51 UTC

This package is auto-updated.

Last update: 2024-12-21 17:47:50 UTC


README

CaptainHook Hooks

This repository contains a collection of hooks for CaptainHook.

Installation and Setup

  1. Add our package registry to your composer.json

     composer config repositories.63 composer https://git.gsb-itzbund.de/api/v4/group/63/-/packages/composer/packages.json
    

    Open CoDE

     composer config repositories.captainhook-hooks vcs https://gitlab.opencode.de/bmi/government-site-builder-11/extensions/captainhook-hooks
    
  2. Login to our package registry (git.gsb-itzbund.de only)

    (use your GitLab credentials)

     composer config gitlab-token.git.gsb-itzbund.de <personal_access_token>
    

    Using a deploy token:

    composer config gitlab-token.git.gsb-itzbund.de <deploy_token_username> <deploy_token>
    

    Using a CI/CD job token: (in gitlab ci - git.gsb-itzbund.de jobs only):

     composer config -- gitlab-token.git.gsb-itzbund.de gitlab-ci-token $CI_JOB_TOKEN
    
  3. Add the package to your project

     composer require --dev captainhook/captainhook-phar
     composer require --dev ramsey/conventional-commits
     composer require --dev itzbund/captainhook-hooks
     # optionally
     composer require --dev captainhook/hook-installer
    
  4. Add Hook into your Config Example:

     "commit-msg": {
       "enabled": true,
         "actions": [
           {
             "action": "\\Ramsey\\CaptainHook\\ValidateConventionalCommit",
             "options": {
               "config": {
                 "requiredFooters": [
                   "Refs"
                 ]
               }
             },
             "conditions": [
               {
                 "exec": "\\ITZBund\\CaptainHookHooks\\HookConditions\\NotMergeOrRevert"
               }
             ]
           }
         ]
       },
    
  5. Install the hooks

     vendor/bin/captainhook install
    

    or if packages are installed under .composer/

     ./.composer/bin/captainhook install --no-interaction --force -b .composer/vendor/autoload.php commit-msg