{"id":19481635,"url":"https://github.com/mattdodge/sink","last_synced_at":"2026-06-20T10:31:01.890Z","repository":{"id":25147966,"uuid":"28570360","full_name":"mattdodge/sink","owner":"mattdodge","description":"Keep remote directories in \"sink\" with GitHub repositories using webhooks","archived":false,"fork":false,"pushed_at":"2015-01-02T17:56:38.000Z","size":600,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T17:37:23.871Z","etag":null,"topics":["github-webhooks","php","webhook"],"latest_commit_sha":null,"homepage":"http://mattdodge.github.io/sink","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/mattdodge.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":"2014-12-28T20:00:40.000Z","updated_at":"2024-04-30T11:10:51.000Z","dependencies_parsed_at":"2022-08-23T22:00:54.860Z","dependency_job_id":null,"html_url":"https://github.com/mattdodge/sink","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mattdodge/sink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2Fsink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2Fsink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2Fsink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2Fsink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattdodge","download_url":"https://codeload.github.com/mattdodge/sink/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2Fsink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34566920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":["github-webhooks","php","webhook"],"created_at":"2024-11-10T20:05:54.997Z","updated_at":"2026-06-20T10:31:01.866Z","avatar_url":"https://github.com/mattdodge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"sink\n====\n\nOne webhook to rule them all.\n\nOften times, an organization will have multiple directories on a web server that need to be synced to individual GitHub repositories. Ideally, these directories would support some sort of Continuous Deployment as well. Toss in different branches with something like [git flow](http://nvie.com/posts/a-successful-git-branching-model/) and maintaining webhooks can get unruly pretty fast.\n\nThis repository aims to provide a one-stop-shop for all of your GitHub webhooks, relying on server-side config to keep different directories synced up with different branches on different repositories. With the [recent addition of organization-wide webhooks](https://github.com/blog/1933-introducing-organization-webhooks), administrators will ideally only need one webhook to keep all of their directories in \"sink\".\n\n## Basic Usage\n\n1. In some accessible directory on your web server, clone down sink. For example:\n\n    ```sh\n    cd /var/www\n    git clone https://github.com/mattdodge/sink.git\n    ```\n\n2. Copy `config.ini.example` to `config.ini` and modify its contents to match your desired implementation. See [the wiki](https://github.com/mattdodge/sink/wiki/Documentation) for more documentation on configuration options.\n\n    **Be sure to change your SECRET_PHRASE, you will need it in the next step.**\n\n3. From your GitHub organization or from an individual repo, add a webhook to point to your recently cloned sync directory. Following up on our previous example:\n    - **Payload URL**: *http://yourhost.com/sink/*\n    - **Content-Type**: *application/json*\n    - **Secret**: *The secret phrase you configured in step 2*\n    \n#### Adding a sink\n\nIf you want to keep a directory on your web server synced with a branch of a remote repository, it's as easy as adding this to your `config.ini`\n\n```ini\n[live site]\n  GITHUB_ACCOUNT = mattdodge\n  GITHUB_REPO = sink\n  GITHUB_BRANCH = master\n  DIRECTORY = \"/var/www/homepage\"\n```\n\n## Why?\n\nA couple of different things inspired this script, if you can relate to any of these, sink may be for you.\n\n- More and more web servers are coming with SSH access and git installed on them. Might as well make use of them!\n- I normally find myself having multiple web apps on a single web server. I also like to version control each web app in a separate repository. Frankly, I just got really tired of running the following commands over and over and over\n\n    ```sh\n    ssh matt@webserver\n    cd path/to/webappD\n    git pull\n    ```\n- It's pretty easy to add a simple endpoint that `cd`'s into the directory, and then pull the code down. The problem is you have to add a webhook to each repository and keep track of them all. This is what I used to do, but I never liked how it would pull down on every push to every branch. \n- Like I mentioned earlier, I'm a huge proponent of [git flow](http://nvie.com/posts/a-successful-git-branching-model/). I wanted a way to keep my staging servers in sync with my **develop** branch and my production servers in sync with **master** without having different scripts and different webhooks.\n- CI tools typically integrate pretty easily with GitHub, but they are really too heavy for what you normally need just when syncing a repo.\n\n\n## Documentation\n\nCheck out more documentation about the configuration options in the [Documentation Wiki](https://github.com/mattdodge/sink/wiki/Documentation).\n\n\n## Examples\n\nWe've got a couple of cool examples of using sink in the [Examples Wiki](https://github.com/mattdodge/sink/wiki/Cool-Examples)\n\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT) - you know the drill, blah blah blah\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdodge%2Fsink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattdodge%2Fsink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdodge%2Fsink/lists"}