{"id":13821562,"url":"https://github.com/tmaier/gitlab-auto-merge-request","last_synced_at":"2025-03-21T09:32:09.428Z","repository":{"id":67507120,"uuid":"103015218","full_name":"tmaier/gitlab-auto-merge-request","owner":"tmaier","description":"Tool to automatically open Merge Requests on GitLab (if none exists already)","archived":false,"fork":false,"pushed_at":"2018-10-19T15:45:40.000Z","size":20,"stargazers_count":73,"open_issues_count":2,"forks_count":24,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-15T16:17:54.722Z","etag":null,"topics":["gitlab","gitlab-ci"],"latest_commit_sha":null,"homepage":"https://gitlab.com/tmaier/gitlab-auto-merge-request","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmaier.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-10T08:39:29.000Z","updated_at":"2025-02-11T21:33:34.000Z","dependencies_parsed_at":"2023-05-13T03:15:49.746Z","dependency_job_id":null,"html_url":"https://github.com/tmaier/gitlab-auto-merge-request","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmaier%2Fgitlab-auto-merge-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmaier%2Fgitlab-auto-merge-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmaier%2Fgitlab-auto-merge-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmaier%2Fgitlab-auto-merge-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmaier","download_url":"https://codeload.github.com/tmaier/gitlab-auto-merge-request/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130278,"owners_count":20402753,"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":["gitlab","gitlab-ci"],"created_at":"2024-08-04T08:01:23.981Z","updated_at":"2025-03-21T09:32:09.132Z","avatar_url":"https://github.com/tmaier.png","language":"Shell","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# Open GitLab Merge Requests automatically\n\n[![Docker Automated buil](https://img.shields.io/docker/automated/tmaier/gitlab-auto-merge-request.svg)](https://hub.docker.com/r/tmaier/gitlab-auto-merge-request/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/tmaier/gitlab-auto-merge-request.svg)](https://hub.docker.com/r/tmaier/gitlab-auto-merge-request/)\n[![Gitlab Project](https://img.shields.io/badge/GitLab-Project-554488.svg)](https://gitlab.com/tmaier/gitlab-auto-merge-request)\n\nThis script is meant to be used in GitLab CI to automatically open Merge Requests for feature branches, if there is none yet.\n\nThe script is provided as dedicated docker image to improve maintainability in the future.\n\nIt is based on the script and idea of [Riccardo Padovani](https://rpadovani.com), which he introduced with his blog post [How to automatically create new MR on Gitlab with Gitlab CI](https://rpadovani.com/open-mr-gitlab-ci).\nThanks for providing this.\n\n## Instructions\n\n### 1) `GITLAB_PRIVATE_TOKEN`\nSet a secret variable in your GitLab project with your private token.\nName it `GITLAB_PRIVATE_TOKEN`.\nThis is necessary to raise the Merge Request on your behalf.\n\n### 2) `.gitlab-ci.yml`\n\nAdd the following to your `.gitlab-ci.yml` file:\n\n```yaml\nstages:\n  - openMr\n  - otherStages\n\nOpen Merge Request:\n  image: tmaier/gitlab-auto-merge-request:1\n  before_script: [] # We do not need any setup work, let's remove the global one (if any)\n  variables:\n    GIT_STRATEGY: none # We do not need a clone of the GIT repository to create a Merge Request\n  stage: openMr\n  only:\n    - /^feature\\/*/ # We have a very strict naming convention\n  script:\n    - merge-request.sh # The name of the script\n```\n\nYou can see this in action at [`.gitlab-ci.yml` of this project](.gitlab-ci.yml).\n\n## Docker images\n\nThe images are hosted on [Docker Hub](https://hub.docker.com/r/tmaier/gitlab-auto-merge-request).\n\nTwo tags are noteworthy:\n* `latest`: Latest release on `master` branch of this project\n* `1`: Latest stable release of `1.x` version (see note on Semantic Versioning below)\n\n## This project is managed on GitLab\n\nThe [GitHub project][] is only a mirror of the [GitLab project][].\n\n[GitHub project]: https://github.com/tmaier/gitlab-auto-merge-request\n[GitLab project]: https://gitlab.com/tmaier/gitlab-auto-merge-request\n\nPlease open Issues and Merge Requests at the [GitLab project][].\n\n## Versioning\n\nThis project follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\nFollowing are defined as APIs according to the spec:\n* How to call this script from `.gitlab-ci.yml`\n* Required Environment Variables\n\nFollowing are not considered as API according to the spec:\n* `Dockerfile` and base image used\n\n## Authors\n\n* Docker part: [Tobias L. Maier](http://tobiasmaier.info)\n* Script and idea: [Riccardo Padovani](https://rpadovani.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmaier%2Fgitlab-auto-merge-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmaier%2Fgitlab-auto-merge-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmaier%2Fgitlab-auto-merge-request/lists"}