{"id":15421051,"url":"https://github.com/cjsheets/git-webhook-deploy","last_synced_at":"2025-10-25T10:06:58.576Z","repository":{"id":143840201,"uuid":"83110453","full_name":"cjsheets/git-webhook-deploy","owner":"cjsheets","description":"Parse webhooks from GitHub, Bitbucket or VSTS and issue Pulls on local repositories. Lightweight CI solution.","archived":false,"fork":false,"pushed_at":"2018-04-30T03:45:08.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T12:51:58.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/cjsheets.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-25T06:02:57.000Z","updated_at":"2018-07-26T03:22:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"915fed0b-bc92-45bd-978f-bf642b4b09e9","html_url":"https://github.com/cjsheets/git-webhook-deploy","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"d2efaa4746420eb6913f029c273bbf02be128d29"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cjsheets/git-webhook-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsheets%2Fgit-webhook-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsheets%2Fgit-webhook-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsheets%2Fgit-webhook-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsheets%2Fgit-webhook-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjsheets","download_url":"https://codeload.github.com/cjsheets/git-webhook-deploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsheets%2Fgit-webhook-deploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280936557,"owners_count":26416583,"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-25T02:00:06.499Z","response_time":81,"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-10-01T17:32:56.026Z","updated_at":"2025-10-25T10:06:58.559Z","avatar_url":"https://github.com/cjsheets.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Git Deploy\n==========\n\nParse webhooks from [GitHub](https://github.com/), [Bitbucket](https://bitbucket.org/) or [VSTS](https://www.visualstudio.com/team-services/) and perform pull requests on a local repository.\n\nBuild your own CI workflow:\n* Server receives an HTTP webhook and calls `git_deploy.py`\n  * (Flask/Gunicorn is a great light-weight option but anything that can forward requests to a python script works)\n* Request is validated against `settings.py`\n* Local repository performs a git pull\n* Email notifications is sent\n\nHow to Use\n----------\n\n**settings.py**\n\nFirst, you need to copy `settings_example.py` to `settings.py`:\n\n* Set `ENABLE_EMAIL = False` or set each MAILGUN property.\n* Set `ENABLE_LOGFILE = False` or ensure the user that launches git_deploy has write permission to `LOGFILE`.\n* Setup `PROVIDERS`:\n  * Remove any providers you're not using\n  * Each object in the `repo_branch` array represents a repository to deploy\n\n**Customizing**\n\nDepending on your provider, the JSON provided in the HTTP request may vary from what `git_deploy.py` expects. This script is fairly short to make it easier to customize. Try the Development instructions below for customization.\n\nIf you have any trouble, I recommend capturing the JSON using a tool like ngrok and ensuring the hard-coded values (ex. `data['repository']['name']`) match those in your request.\n\nI included sample payloads in the `/doc/` folder, however I imagine those are susceptible to change.\n\nDevelopment\n-----------\n\nAfter cloning the repository, setup a dev environment.\n\n```\nvirtualenv .env\nsource .env/bin/activate\npip install -r doc/requirements.txt\n```\n\nNext, prepare `settings.py` as described above. Change `LOGLEVEL = 'DEBUG'`\n\nStart a flask-listener to receive webhooks:\n\n```\n.env/bin/gunicorn git_deploy:APP -b 127.0.0.1:9090\n```\n\nI like to use [ngrok](https://ngrok.com/download) to expose our newly created server to the world.\n\n```\n./ngrok http 9090\n```\n\nFinally, trigger a POST message from your git provider of choice.\n\nWatch the Flask console for messages about the request. If you're using ngrok, you can visit its web interface and replay the webhook until you get the desired result.\n\nHappy Deploying!\n\n### To-Do:\n\n* Add support for git secret\n* Add support for multiple repos from the same listener\n\n### License\n\nMIT License\n\n[![Analytics](https://cjs-beacon.appspot.com/UA-10006093-3/github/cjsheets/git-webhook-deploy?pixel)](https://github.com/cjsheets/git-webhook-deploy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjsheets%2Fgit-webhook-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjsheets%2Fgit-webhook-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjsheets%2Fgit-webhook-deploy/lists"}