{"id":17785067,"url":"https://github.com/eun/merge-with-label","last_synced_at":"2025-03-16T04:30:59.722Z","repository":{"id":181689464,"uuid":"620689024","full_name":"Eun/merge-with-label","owner":"Eun","description":"A github bot for merging \u0026 updating pull requests with a label.","archived":false,"fork":false,"pushed_at":"2025-03-13T04:18:59.000Z","size":3404,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T23:32:07.787Z","etag":null,"topics":["bot","github","go","golang","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["Eun"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"Eun","issuehunt":"eun","otechie":null,"custom":null}},"created_at":"2023-03-29T07:18:11.000Z","updated_at":"2025-03-03T12:12:49.000Z","dependencies_parsed_at":"2023-07-16T22:02:02.757Z","dependency_job_id":"9109dfd5-73ba-432a-96af-38f6a3df2c54","html_url":"https://github.com/Eun/merge-with-label","commit_stats":null,"previous_names":["eun/merge-with-label"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fmerge-with-label","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fmerge-with-label/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fmerge-with-label/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fmerge-with-label/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eun","download_url":"https://codeload.github.com/Eun/merge-with-label/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826788,"owners_count":20354220,"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":["bot","github","go","golang","hacktoberfest"],"created_at":"2024-10-27T08:23:13.437Z","updated_at":"2025-03-16T04:30:58.495Z","avatar_url":"https://github.com/Eun.png","language":"Go","funding_links":["https://github.com/sponsors/Eun","https://liberapay.com/Eun","https://issuehunt.io/r/eun"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"829\" height=\"170\" src=\"header.png\"\u003e\n\u003c/p\u003e\n\n[![Actions Status](https://github.com/Eun/merge-with-label/workflows/push/badge.svg)](https://github.com/Eun/merge-with-label/actions)\n[![Coverage Status](https://coveralls.io/repos/github/Eun/merge-with-label/badge.svg?branch=main)](https://coveralls.io/github/Eun/merge-with-label?branch=main)\n[![PkgGoDev](https://img.shields.io/badge/pkg.go.dev-reference-blue)](https://pkg.go.dev/github.com/Eun/merge-with-label)\n[![go-report](https://goreportcard.com/badge/github.com/Eun/merge-with-label)](https://goreportcard.com/report/github.com/Eun/merge-with-label)\n---\nA github bot for merging \u0026 updating pull requests with a label.\n\n## Functionality\nThis bot can merge and keep your branches up to date with the latest changes from base (master/main).\n\n## Config file\nPlace `merge-with-label.yml` in `.github` repository:\n\n```yaml\nversion: 1\nmerge:\n  # specify a list of labels that indicate whether a pull request is eligible\n  # for merging (regex)\n  # (or-list, only one label must be present on a pull request)\n  # (leave empty to disable the merge feature)\n  labels:\n    - \"merge\"\n  # strategy to merge (can be \"commit\", \"squash\" or \"rebase\")\n  strategy: \"squash\"\n  # amount of required approvals before merging\n  #requiredApprovals: 1\n  # specify a list of users that are required for review (regex)\n  # (and-list, all users need to approve)\n  #requireApprovalsFrom:\n  #  -\n  # names of the checks that are need to pass before merging (regex)\n  # (and-list, all checks need to pass)\n  requiredChecks:\n    - \".*\"\n  # require a linear history\n  requireLinearHistory: false\n  # delete branch after merging\n  deleteBranch: true\n  # never merge pull requests that were created by these users (regex)\n  #ignoreFromUsers:\n  #  - \"dependabot\"\n  # never merge pull requests that match one of these titles (regex)\n  #ignoreWithTitles:\n  #  - \"chore:.+\"\n  # never update pull requests that match one of these labels (regex)\n  #ignoreWithLabels:\n  #  - \"dont-merge\"\nupdate:\n  # specify a list of labels that indicate whether a pull request is eligible\n  # for updating (regex)\n  # (or-list, only one label must be present on a pull request)\n  # (leave empty to disable the update feature)\n  labels: \n    - \"update-branch\"\n  # never update pull requests that were created by these users (regex)\n  ignoreFromUsers:\n    - \"dependabot\"\n  # never update pull requests that match one of these titles (regex)\n  #ignoreWithTitles:\n  #  - \"chore:.+\"\n  # never update pull requests that match one of these titles (regex)\n  #ignoreWithTitles:\n  #  - \"chore:.+\"\n  # never update pull requests that match one of these labels (regex)\n  #ignoreWithLabels:\n  #  - \"dont-update\"\n```\n\n## Setup\n1. Create a new github app with following permissions \u0026 events\n   ### Repository Permissions\n   | Permission      | Level          |\n   |-----------------|----------------|\n   | Actions         | Read           |\n   | Checks          | Read and write |\n   | Commit statuses | Read-Only      |\n   | Contents        | Read and write |\n   | Metadata        | Read-Only      |\n   | Pull requests   | Read and write |\n   | Workflows       | Read and write |\n\n   ### Subscribe to events \n   - Check run\n   - Pull request\n   - Pull request review\n   - Push\n   - Status\n2. Create a private key and save it\n3. Note down the app id\n4. Spin up the instance somewhere using `docker compose`\n   ### docker-compose.yml\n   ```yaml\n   version: '3.9'\n   services:\n     nats:\n       image: nats:2.9.20\n       restart: unless-stopped\n       command: [\"--js\", \"-user\", \"nats\", \"-pass\", \"425751fd-62e2-4b73-9e1b-5a9b0dafc5ad\"]\n   \n     server:\n       image: ghcr.io/eun/merge-with-label:latest\n       restart: unless-stopped\n       command: \"server\"\n       ports:\n         - \"8000:8000\"\n       environment:\n         PORT: 8000\n         NATS_URL: nats://nats:425751fd-62e2-4b73-9e1b-5a9b0dafc5ad@nats:4222\n       depends_on:\n         - nats\n   \n     worker:\n       image: ghcr.io/eun/merge-with-label:latest\n       restart: unless-stopped\n       command: \"worker\"\n       volumes:\n         - \"./private-key.pem:/private-key.pem:ro\"\n       environment:\n         NATS_URL: nats://nats:425751fd-62e2-4b73-9e1b-5a9b0dafc5ad@nats:4222\n         APP_ID: \u003cyour app id\u003e\n         PRIVATE_KEY: /private-key.pem\n       depends_on:\n         - server\n   ```\n   \u003e Make sure you fill in your app id, provide the private-key.pem file\n   \u003e and modify the nats username and password\n5. Point the webhook url to the deployment\n\n\n### Fine Tuning Settings\nFollowing environment variables are available\n\n| Variable                          | Default Value       |\n|-----------------------------------|---------------------|\n| `AllowedRepositories`             | `.*`                |\n| `AllowOnlyPublicRepositories`     | `false`             |\n| `BotName`                         | `merge-with-label`  |\n| `StreamName`                      | `mwl_bot_events`    |\n| `PullRequestSubject`              | `pull_request`      |\n| `PushSubject`                     | `push`              |\n| `MessageRetryAttempts`            | `5`                 |\n| `MessageRetryWait`                | `15s`               |\n| `RateLimitBucketName`             | `mwl_rate_limit`    |\n| `RateLimitBucketTTL`              | `24h`               |\n| `RateLimitInterval`               | `30s`               |\n| `AccessTokensBucketName`          | `mwl_access_tokens` |\n| `AccessTokensBucketTTL`           | `24h`               |\n| `ConfigsBucketName`               | `mwl_configs`       |\n| `ConfigsBucketTTL`                | `24h`               |\n| `CheckRunsBucketName`             | `mwl_check_runs`    |\n| `CheckRunsBucketTTL`              | `10m`               |\n| `DurationBeforeMergeAfterCheck`   | `10s`               |\n| `DurationToWaitAfterUpdateBranch` | `30s`               |\n| `MaxMessageAge`                   | `10m`               |\n| `MessageChannelSizePerSubject`    | `64`                |\n\n\u003e Additionally, you can enable debug logging by setting the `DEBUG`\n\u003e environment variable to `true`.\n\n## Build History\n[![Build history](https://buildstats.info/github/chart/Eun/merge-with-label?branch=master)](https://github.com/Eun/merge-with-label/actions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feun%2Fmerge-with-label","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feun%2Fmerge-with-label","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feun%2Fmerge-with-label/lists"}