{"id":19987184,"url":"https://github.com/submariner-io/submariner-bot","last_synced_at":"2025-05-04T08:31:14.488Z","repository":{"id":37047367,"uuid":"228366197","full_name":"submariner-io/submariner-bot","owner":"submariner-io","description":"Bot that maintains branches for in-progress PRs.","archived":false,"fork":false,"pushed_at":"2025-05-02T11:44:48.000Z","size":4596,"stargazers_count":1,"open_issues_count":1,"forks_count":6,"subscribers_count":8,"default_branch":"devel","last_synced_at":"2025-05-02T12:37:27.985Z","etag":null,"topics":["branches","github","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","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/submariner-io.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-16T10:54:08.000Z","updated_at":"2025-05-02T11:43:43.000Z","dependencies_parsed_at":"2023-12-01T23:25:09.110Z","dependency_job_id":"e8a6ed23-2bbc-4c04-beb8-57477a0e141b","html_url":"https://github.com/submariner-io/submariner-bot","commit_stats":{"total_commits":101,"total_committers":8,"mean_commits":12.625,"dds":0.6633663366336633,"last_synced_commit":"b26238c9581d9c7e12741eea2d14fefd882e5d39"},"previous_names":["submariner-io/pr-brancher-webhook"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/submariner-io%2Fsubmariner-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/submariner-io%2Fsubmariner-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/submariner-io%2Fsubmariner-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/submariner-io%2Fsubmariner-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/submariner-io","download_url":"https://codeload.github.com/submariner-io/submariner-bot/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252307912,"owners_count":21727093,"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":["branches","github","webhook"],"created_at":"2024-11-13T04:34:05.603Z","updated_at":"2025-05-04T08:31:12.727Z","avatar_url":"https://github.com/submariner-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# submariner-bot\n\n## How it works\n\nsubmariner-bot listens for webhook events on port 3000 over http. Those events\nare in the github webhook event format\ndescribed [here](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads)\n\nWe use a [library](https://github.com/go-playground/webhooks/tree/master/github) that provides a good interface to handle those events\nwhich are handled [here](https://github.com/submariner-io/submariner-bot/blob/devel/pkg/handler/handler.go):\n\n## Developing and testing locally\n\nYou need Go to run and test submariner-bot locally:\n\n```bash\nexport GO111MODULE=on\nexport GITHUB_TOKEN=\u003ca token, you can create one in https://github.com/settings/tokens\u003e\nexport WEBHOOK_SECRET=your-random-phrase # this is a password for anybody accessing submariner-bot\nexport SSH_PK=/your/ssh/private/key\ngo run pkg/main/main.go  # or just do it from your favorite IDE\n```\n\nThen you can push events to localhost:3000.\nThere are probably tools to simulate events but if you want to simulate it on your host you can create a public endpoint with\n[ngrok](https://ngrok.com/).\nYou should sign up for the free version so your tunnels will not be time-limited.\n\nOn another terminal (keep it open):\n\n```bash\n$ ngrok authtoken \u003cthis is provided when you sign-up, optional\u003e\n$ ngrok http  3000\nngrok by @inconshreveable                                                    (Ctrl+C to quit)\n\nSession Status                online\nAccount                       your-email (Plan: Free)\nVersion                       2.3.40\nRegion                        United States (us)\nWeb Interface                 http://127.0.0.1:4040\nForwarding                    http://f05c3eb7fe60.ngrok.io -\u003e http://localhost:3000\nForwarding                    https://f05c3eb7fe60.ngrok.io -\u003e http://localhost:3000\n\nConnections                   ttl     opn     rt1     rt5     p50     p90\n                              0       0       0.00    0.00    0.00    0.00\n```\n\nAt this point you'll need a submariner admin to [setup your webhook](https://github.com/organizations/submariner-io/settings/hooks/new)\nwhile in development with the forwarding address `https://f05c3eb7fe60.ngrok.io` and your WEBHOOK_SECRET.\n\nTry not to close ngrok to avoid the webhook URL from changing (starting a new session)\n\n## setup\n\n```bash\nexport NS=pr-brancher-webhook\nkubectl create namespace $NS\n# create a bot account with permission to your repos, and create a token in your bot account: https://github.com/settings/tokens\nkubectl create -n $NS secret generic pr-brancher-secrets --from-file=ssh_pk=./id_rsa --from-literal=githubToken=$GITHUB_TOKEN\nkubectl apply -n $NS -f deployment/role.yml\nkubectl apply -n $NS -f deployment/deployment.yaml\nkubectl apply -n $NS -f deployment/service.yml\n\n```\n\n### setup with https/letsencrypt\n\n```bash\nkubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.12.0/cert-manager.yaml\nkubectl apply -f deployment/letsencrypt-prod-issuer.yaml # you may need to edit the class in the yaml based on your ingress\n```\n\n## update image\n\n```bash\nkubectl rollout restart deployment/pr-brancher\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubmariner-io%2Fsubmariner-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubmariner-io%2Fsubmariner-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubmariner-io%2Fsubmariner-bot/lists"}