{"id":21819422,"url":"https://github.com/dflydev/dflydev-git-subsplit-github-webhook","last_synced_at":"2025-10-11T02:43:03.832Z","repository":{"id":6280510,"uuid":"7514497","full_name":"dflydev/dflydev-git-subsplit-github-webhook","owner":"dflydev","description":"GitHub WebHook for Git subsplits managed by dflydev-git-subsplit.","archived":false,"fork":false,"pushed_at":"2018-02-07T00:48:18.000Z","size":12,"stargazers_count":28,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T02:29:18.106Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dflydev.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":"2013-01-09T03:53:58.000Z","updated_at":"2020-07-11T00:15:51.000Z","dependencies_parsed_at":"2022-08-24T18:14:02.085Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/dflydev-git-subsplit-github-webhook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dflydev/dflydev-git-subsplit-github-webhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-git-subsplit-github-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-git-subsplit-github-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-git-subsplit-github-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-git-subsplit-github-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/dflydev-git-subsplit-github-webhook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-git-subsplit-github-webhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005968,"owners_count":26084004,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-27T16:19:03.256Z","updated_at":"2025-10-11T02:43:03.812Z","avatar_url":"https://github.com/dflydev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Git Subsplit GitHub WebHook\n===========================\n\n[GitHub][1] WebHook for Git subsplits managed by [git-subsplit][2].\n\nAutomates the process of keeping one-way read-only subtree splits up to date\nwith the source repository.\n\nThe WebHook works in two parts, a web listener and a worker. The web listener\nadds requests to Redis and the worker processes the requests.\n\nThe worker will interact with the system's git as the user running the worker.\n**This means that the user running the worker should have its key added to\nthe appropriate GitHub accounts.**\n\nDuring testing it would make sense to run the worker manually. For production\ndeployments it would probably make more sense to runt he worker using something\nalong the lines of [upstart][6] or [supervisor][7].\n\n\nUsage\n-----\n\n### git-subsplit\n\nEnsure that [git-subsplit][2] is installed correctly. If is not available\nin your version of git (likely true for versions older than 1.7.11)\nplease install it manually from [here][5].\n\nYou should initialize subsplit with a git repository:\n\n    cd /home/myuser\n    git subsplit init git@github.com:orga/repo.git\n\nIt will create a `.subsplit` working directory that you will use later.\n\n### Installation\n\n    git clone git@github.com:dflydev/dflydev-git-subsplit-github-webhook.git\n    mv dflydev-git-subsplit-github-webhook/ webhook/\n    cd webhook\n    composer install\n\nN.B. If you need composer : [https://getcomposer.org/download/][8]\n\n### Redis\n\nEnsure that the Redis server is running.\n\n### Configure\n\nCopy `config.json.dist` to `config.json` and edit it accordingly. Please make sure\nto pay special attention to setting `working-directory` correctly.\nDon't forget to change the `webhook-secret` to secure your webhook.\n\n### Web Server\n\nSetup a virtual host pointing to `web/` as its docroot. Assuming the virtual host\nis **webhook.example.com**, test the WebHook by visiting the following URL:\n**http://webhook.example.com/subsplit-webhook.php**\n\n### Worker\n\nStart the worker by running `php bin/subsplit-worker.php`.\n\n### GitHub\n\nFrom your repository go to **Settings** / **Service Hooks** / **WebHook URLs**.\nEnter the URL to your WebHook and your secret. Then click **Update Settings**.\n\nClick **WebHook URLs** again and click **Test Hook**.\n\nIf everything is setup correctly the Worker should give you some sort of feedback.\n\n\nConfiguration\n-------------\n\n### Example\n\n```\n{\n    \"working-directory\": \"/home/myuser/.subsplit\",\n    \"webhook-secret\": \"ThisTokenIsNotSoSecretChangeIt\",\n    \"projects\": {\n        \"project-1\": {\n            \"url\": \"git@github.com:orga/private-repo.git\",\n            \"splits\": [\n                \"src/public:git@github.com:orga/public-repo.git\"\n            ]\n        }\n    }\n}\n```\n\n### Schema\n\n#### working-directory\n\n*String. Default: None. **Required.***\n\nThe directory in which the subsplits will be processed. This is more or less\na temporary directory in which all projects will have their subsplit initialized.\n\n#### webhook-secret\n\n*String. Default: \"ThisTokenIsNotSoSecretChangeIt\". **Required.***\n\nThis is a secret string that should be unique to your webhook. It's used to secure communication between the webhook and github.\nYou can use a *secret generator* if you want a strong string.\n\n#### projects\n\n*Object. **Required**.*\n\nAn object whose keys are project names and values are a project description\nobject.\n\nProject names should only contain a-z, A-Z, 0-9, `.`, `_`, and `-`.\n\nEach project description object can have the following properties:\n\n * **url**:\n   The URL for the project. The WebHook will check each incoming request's\n   `url` property against each project's listed `url` property to determine\n   which project the request is for.\n   \n   This URL should be like: **git@github.com:orga/repo.git**\n   \n * **repository-url**:\n   The URL that `git` will use to check out the project. This setting is\n   optional. If it is not defined the repository URL will be read from the\n   incoming request.\n * **splits**:\n   An array of subsplit definitions as defined by [git-subsplit][2].\n   The pattern for the splits is `${subPath}:${url}`.\n\n\nLicense\n-------\n\nMIT, see LICENSE.\n\n\nCommunity\n---------\n\nIf you have questions or want to help out, join us in the\n**#dflydev** channel on irc.freenode.net.\n\n\nNot Invented Here\n-----------------\n\nThis project is based heavily on work originally done by [igorw][4].\nThanks Igor. :)\n\n\n[1]: https://github.com\n[2]: https://github.com/dflydev/git-subsplit\n[3]: http://getcomposer.org\n[4]: https://igor.io\n[5]: https://github.com/apenwarr/git-subtree\n[6]: http://upstart.ubuntu.com\n[7]: http://supervisord.org\n[8]: https://getcomposer.org/download/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-git-subsplit-github-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fdflydev-git-subsplit-github-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-git-subsplit-github-webhook/lists"}