{"id":35826036,"url":"https://github.com/gasoid/merge-bot","last_synced_at":"2026-06-10T07:00:36.990Z","repository":{"id":262327865,"uuid":"886560904","full_name":"Gasoid/merge-bot","owner":"Gasoid","description":"The bot makes useful things, it supports gitlab and helps with MRs: merge, check, update","archived":false,"fork":false,"pushed_at":"2026-06-06T13:26:06.000Z","size":10558,"stargazers_count":26,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-06T15:15:43.473Z","etag":null,"topics":["bot","gitlab","golang","merge-request","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Gasoid.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-11T07:42:13.000Z","updated_at":"2026-04-13T16:04:31.000Z","dependencies_parsed_at":"2025-06-21T14:19:52.286Z","dependency_job_id":"20ec896a-d8a9-4540-a6d3-5cd1c33d769f","html_url":"https://github.com/Gasoid/merge-bot","commit_stats":null,"previous_names":["gasoid/merge-bot"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/Gasoid/merge-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gasoid%2Fmerge-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gasoid%2Fmerge-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gasoid%2Fmerge-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gasoid%2Fmerge-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gasoid","download_url":"https://codeload.github.com/Gasoid/merge-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gasoid%2Fmerge-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34140775,"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-10T02:00:07.152Z","response_time":89,"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":["bot","gitlab","golang","merge-request","webhook"],"created_at":"2026-01-07T20:15:47.999Z","updated_at":"2026-06-10T07:00:36.985Z","avatar_url":"https://github.com/Gasoid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MergeBot: Merge Request Bot for GitLab\n\n[![Docker Image Version](https://img.shields.io/docker/v/gasoid/merge-bot?style=flat-square\u0026label=docker\u0026sort=semver)](https://hub.docker.com/r/gasoid/merge-bot)\n[![Helm Chart Version](https://img.shields.io/github/v/release/gasoid/helm-charts?style=flat-square\u0026label=helm\u0026filter=merge-bot-*)](https://github.com/gasoid/helm-charts/releases)\n[![Latest Release](https://img.shields.io/github/v/release/gasoid/merge-bot?style=flat-square)](https://github.com/gasoid/merge-bot/releases/latest)\n\n![screen](screen.webp)\n\nMergeBot is an automated merge request bot for GitLab that enforces repository-specific rules and helps streamline your code review process.\n\n## Features\n\n- ✅ **Title validation** - Enforce naming conventions with regex patterns\n- ✅ **Automated merging** - Merge on command when rules are met\n- ✅ **Branch updates** - Automatically pull changes from target branch\n- ✅ **Stale branch cleanup** - Remove outdated branches automatically\n- ✅ **Customizable rules** - Per-repository configuration via `.mrbot.yaml`\n\n## Quick Start\n\nTry the bot on our [demo repository](https://gitlab.com/Gasoid/sugar-test) or invite [@mergeapprovebot](https://gitlab.com/mergeapprovebot) to your project.\n\n### Available Commands\n\n- `!merge` - Merges MR if all repository rules are satisfied\n- `!check` - Validates whether the MR meets all rules\n- `!update` - Updates the branch from the target branch (e.g., main/master)\n- `!rerun` - Re-run pipeline, e.g. `!rerun #123123333` or `!rerun 123123333`, command will run pipeline against the branch of the merge request with variables of provided pipeline (e.g. 123123333)\n\n## Table of Contents\n\n- [Installation](#installation)\n  - [GitLab Cloud](#gitlab-cloud)\n  - [Docker Compose](#docker-compose)\n  - [Helm](#helm)\n  - [CLI](#cli)\n- [Configuration](#configuration)\n  - [Required Bot Permissions](#required-bot-permissions)\n  - [Webhook Secret](#webhook-secret)\n  - [Config File](#config-file)\n- [Features](#features-1)\n  - [Stale Branches](#stale-branches)\n  - [Greetings](#greetings)\n- [Demo](#demo)\n\n## Installation\n\n### GitLab Cloud\n\n1. **Invite the bot**: Add [@mergeapprovebot](https://gitlab.com/mergeapprovebot) to your repository with **Maintainer** role\n2. **Configure webhook**: \n   - URL: `https://mergebot.tools/mergebot/webhook/gitlab/`\n   - Trigger events: Comments and Merge Request events\n3. **Create configuration**: Add `.mrbot.yaml` to your repository root (see [Config File](#config-file))\n4. **Start using**: Create an MR and use commands like `!check` and `!merge`\n\n### Docker Compose\n\n1. **Create environment file** (`bot.env`):\n```env\nGITLAB_TOKEN=your_personal_access_token\n# Optional: Enable TLS\n# TLS_ENABLED=true\n# TLS_DOMAIN=your-domain.com\n# GITLAB_URL=https://your-gitlab-instance.com\n```\n\n2. **Run the container**:\n```bash\ndocker-compose up -d\n```\n\n3. **Configure webhook**: Follow the [GitLab Cloud](#gitlab-cloud) instructions, but use your own bot URL\n\n### Helm\n\nAdd the Helm repository:\n```bash\nhelm repo add merge-bot https://gasoid.github.io/helm-charts\nhelm repo update\n```\n\nInstall the chart:\n```bash\nhelm install my-merge-bot merge-bot/merge-bot\n```\n\nFor webhook configuration, follow the [GitLab Cloud](#gitlab-cloud) instructions.\n\n### CLI\n\n1. **Set environment variables**:\n```bash\nexport GITLAB_TOKEN=\"your_token\"\nexport GITLAB_URL=\"\"  # Optional: for self-hosted GitLab\nexport TLS_ENABLED=\"true\"  # Optional\nexport TLS_DOMAIN=\"bot.yourdomain.com\"  # Optional\n```\n\n2. **Run the bot**:\n```bash\ngo run ./\n```\n\n**Available CLI flags**:\n```\n  -debug\n        Enable debug logging (also via DEBUG)\n  -gitlab-token string\n        GitLab personal access token (also via GITLAB_TOKEN)\n  -gitlab-url string\n        GitLab instance URL for self-hosted (also via GITLAB_URL)\n  -gitlab-max-repo-size string\n        Maximum repository size (default: 500Mb, also via GITLAB_MAX_REPO_SIZE)\n  -tls-domain string\n        Domain for SSL certificate (also via TLS_DOMAIN)\n  -tls-enabled\n        Enable TLS with Let's Encrypt (also via TLS_ENABLED)\n  -sentry-enabled\n        Enable Sentry error reporting (default: true, also via SENTRY_ENABLED)\n  -plugins string\n        Comma-separated list of plugin config URLs or paths (also via PLUGINS)\n  -version\n      \tShows version and build time\n```\n\n## Configuration\n\n### Required Bot Permissions\n\n- **Bot role**: Maintainer (required for commenting, merging, and deleting branches)\n- **Access token scopes**: `api`, `read_repository`, `write_repository`\n\n### Webhook Secret\n\nEnhance security by using webhook secrets:\n\n1. **Create CI/CD variable**: Add `MERGE_BOT_SECRET` to your GitLab project variables\n2. **Configure webhook**: Set the same secret value in your webhook configuration\n3. **Verification**: The bot will validate incoming webhooks against this secret\n\n### Config File\n\nCreate `.mrbot.yaml` in your repository root on the default branch:\n\n```yaml\n# all settings are optional, defaults are shown below\n\nrules:\n  approvers: []  # Specific users who must approve (empty = any approver)\n  min_approvals: 1  # Minimum number of approvals required\n  allow_empty_description: true  # Allow empty MR descriptions\n  allow_failing_pipelines: true  # Allow merging with failed pipelines\n  title_regex: \".*\"  # Title validation regex pattern\n\ngreetings:\n  enabled: false  # Send welcome message on new MRs\n  resolvable: false # Whether greeting message can be updated and resolved\n  template: \"Requirements:\\n - Min approvals: {{ .MinApprovals }}\\n - Title regex: {{ .TitleRegex }}\\n\\nSend **!merge** when ready!\"\n\nauto_master_merge: false  # Auto-update branch from target branch\n\nstale_branches_deletion:\n  enabled: false  # Clean up stale branches after merge\n  exclude_branches: [] # List of branch names to exclude from deletion\n  protected: false # Whether to consider protected branches for deletion\n  days: 90  # Consider branches stale after N days\n  batch_size: 5 # Number of branches can be deleted at once\n  wait_days: 1 # Wait N days before MR/branch deletion, merge-bot:stale label is set\n\nplugin_vars: {}  # Custom variables for plugins\n```\n\n#### Example Configuration\n\n```yaml\nrules:\n  approvers:\n    - alice\n    - bob\n  min_approvals: 2\n  allow_empty_description: false\n  allow_failing_pipelines: false\n  title_regex: \"^(feat|fix|docs|style|refactor|test|chore):\"  # Conventional commits\n\ngreetings:\n  enabled: true\n  resolvable: true\n  template: |\n    ## 🤖 MergeBot Requirements\n    \n    - **Min approvals**: {{ .MinApprovals }}\n    - **Title format**: {{ .TitleRegex }}\n    - **Approvers**: {{ .Approvers }}\n    \n    Use `!check` to validate and `!merge` when ready!\n\nauto_master_merge: true\n\nstale_branches_deletion:\n  enabled: true\n  exclude_branches:\n    - main\n    - develop\n  protected: true\n  days: 30\n  batch_size: 2\n  wait_days: 1\n\nplugin_vars:\n  var_name: value  # Custom variables for plugins\n```\n\n## Features\n\n### Plugin support\nPlease read [docs](plugins.md) for more information.\n\n### Stale Branches\n\nWhen enabled, the bot automatically deletes stale branches after each successful merge/update. Branches are considered stale based on the configured number of days since their last activity.\n\n### Greetings\n\nCustomize welcome messages for new merge requests using Go templates. Available variables:\n- `{{ .MinApprovals }}`\n- `{{ .TitleRegex }}`\n- `{{ .Approvers }}`\n\nYou can also enable the `resolvable` option to allow the bot to update and resolve the greeting message once all requirements are met. Merge Request will be blocked until requirements are met. (You need to enable \"All threads must be resolved\" in project settings for this feature to work.)\n\n### Labels\n\nThe bot creates 2 labels:\n- merge-bot:stale\n- merge-bot:auto-update\n\nUse `merge-bot:auto-update` label if you need to update merge request when target branch (master) is updated.\n\n## Demo\n\nTest the bot on our public demo repository: [https://gitlab.com/Gasoid/sugar-test](https://gitlab.com/Gasoid/sugar-test)\n\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasoid%2Fmerge-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgasoid%2Fmerge-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasoid%2Fmerge-bot/lists"}