{"id":17347510,"url":"https://github.com/cryptiklemur/git-hook-handler","last_synced_at":"2025-08-01T21:31:47.465Z","repository":{"id":33627228,"uuid":"37279513","full_name":"cryptiklemur/git-hook-handler","owner":"cryptiklemur","description":"Git Hook Handler","archived":false,"fork":false,"pushed_at":"2020-03-23T18:27:44.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T05:57:30.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptiklemur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-11T18:46:11.000Z","updated_at":"2020-03-23T18:27:27.000Z","dependencies_parsed_at":"2022-08-17T19:30:58.044Z","dependency_job_id":null,"html_url":"https://github.com/cryptiklemur/git-hook-handler","commit_stats":null,"previous_names":["cryptiklemur/git-hook-handler"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptiklemur%2Fgit-hook-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptiklemur%2Fgit-hook-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptiklemur%2Fgit-hook-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptiklemur%2Fgit-hook-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptiklemur","download_url":"https://codeload.github.com/cryptiklemur/git-hook-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228407838,"owners_count":17915080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T16:49:03.156Z","updated_at":"2024-12-06T03:42:46.898Z","avatar_url":"https://github.com/cryptiklemur.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-hook-handler\n\n## Usage\nJust create a `git-hooks.yml` file in your projects base directory, and fill it with an array of commands you want to run:\n\n```yaml\n# git-hook.yml\nconfig:\n    commit-on-error : true # or false\npre-commit:\n    # Simple command\n    - bin/phpcs\n    # or more complex command\n    - phpunit:\n        description : 'Run PHPUnit'\n        command : phpunit\n        exitcode : 0\n    phpcs-fixer:\n        description : 'Checking PHP Syntax with PHP-CS-FIXER'\n        exitcode : 0\n        command : \u003e4\n            COMMIT_RANGE='HEAD~..HEAD' \u0026\u0026\n            CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB \"${COMMIT_RANGE}\") \u0026\u0026\n            if ! echo \"${CHANGED_FILES}\" | grep -qE \"^(\\\\.php_cs(\\\\.dist)?|composer\\\\.lock)$\"; then IFS=$'\\n' EXTRA_ARGS=('--path-mode=intersection' '--' ${CHANGED_FILES[@]}); fi\n            \u0026\u0026 ./vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no \"${EXTRA_ARGS[@]}\"\n\npost-merge:\n    command_name:\n        description : 'lorem ipsum'\n        command : 'mycommand'\n        exitcode : 0\n```\n\nand then place the following in your composer.json, then run `composer install` or `composer update`\n\n```json\n# composer.json\n    \"scripts\": {\n        \"pre-update-cmd\":  \"Aequasi\\\\HookHandler\\\\HookScript::install\",\n        \"pre-install-cmd\": \"Aequasi\\\\HookHandler\\\\HookScript::install\"\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptiklemur%2Fgit-hook-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptiklemur%2Fgit-hook-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptiklemur%2Fgit-hook-handler/lists"}