{"id":21834376,"url":"https://github.com/hmajid2301/gitlab-auto-mr","last_synced_at":"2026-05-19T00:01:31.667Z","repository":{"id":44865032,"uuid":"176016535","full_name":"hmajid2301/gitlab-auto-mr","owner":"hmajid2301","description":"Python script which is used to create MRs on GitLab, mirrored from https://gitlab.com/hmajid2301/gitlab-automation-toolkit/gitlab-auto-mr","archived":false,"fork":false,"pushed_at":"2022-12-08T04:52:35.000Z","size":91,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T21:06:55.921Z","etag":null,"topics":["automation","gitlab","gitlab-ci","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hmajid2301.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-16T19:38:02.000Z","updated_at":"2020-03-01T21:47:36.000Z","dependencies_parsed_at":"2023-01-24T13:00:26.855Z","dependency_job_id":null,"html_url":"https://github.com/hmajid2301/gitlab-auto-mr","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/hmajid2301/gitlab-auto-mr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmajid2301%2Fgitlab-auto-mr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmajid2301%2Fgitlab-auto-mr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmajid2301%2Fgitlab-auto-mr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmajid2301%2Fgitlab-auto-mr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmajid2301","download_url":"https://codeload.github.com/hmajid2301/gitlab-auto-mr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmajid2301%2Fgitlab-auto-mr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33196079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automation","gitlab","gitlab-ci","python"],"created_at":"2024-11-27T20:10:25.242Z","updated_at":"2026-05-19T00:01:31.601Z","avatar_url":"https://github.com/hmajid2301.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr/badges/master/pipeline.svg\n   :target: https://gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr\n   :alt: Pipeline Status\n\n.. image:: https://gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr/badges/master/coverage.svg\n   :target: https://gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr\n   :alt: Coverage\n\n.. image:: https://img.shields.io/pypi/l/gitlab-auto-mr.svg\n   :target: https://pypi.org/project/gitlab-auto-mr/\n   :alt: PyPI Project License\n\n.. image:: https://img.shields.io/pypi/v/gitlab-auto-mr.svg\n   :target: https://pypi.org/project/gitlab-auto-mr/\n   :alt: PyPI Project Version\n\nGitLab Auto MR\n==============\n\nThis is a simple Python cli script that allows you create MR in GitLab automatically. It is intended to be\nused during your CI/CD. However you can chose to use it however you wish.\n\nIt is based on the script and idea of `Riccardo Padovani \u003chttps://rpadovani.com\u003e`_,\nwhich he introduced with his blog post\n`How to automatically create new MR on Gitlab with Gitlab CI \u003chttps://rpadovani.com/open-mr-gitlab-ci\u003e`_.\n\nUsage\n-----\n\nFirst you need to create a personal access token,\n`more information here \u003chttps://docs.gitlab.com/ee/user/profile/personal_access_tokens.html\u003e`_.\nWith the scope ``api``, so it can create the MR using your API. This access token is passed\nto the script with the ``--private-token`` argument.\n\n.. code-block:: bash\n\n    pip install gitlab-auto-mr\n    gitlab_auto_mr --help\n\n  Usage: gitlab_auto_mr [OPTIONS]\n\n    Gitlab Auto MR Tool.\n\n  Options:\n    --private-token TEXT      Private GITLAB token, used to authenticate when\n                              calling the MR API.  [required]\n    --source-branch TEXT      The source branch to merge into.  [required]\n    --project-id INTEGER      The project ID on GitLab to create the MR for.\n                              [required]\n    --gitlab-url TEXT         The gitlab URL i.e. gitlab.com.\n                              [required]\n    --user-id INTEGER         The GitLab user ID to assign the created MR to.\n                              [required]\n    -t, --target-branch TEXT  The target branch to merge onto.\n    -c, --commit-prefix TEXT  Prefix for the MR title i.e. WIP.\n    -r, --remove-branch       Set to True if you want the source branch to be\n                              removed after MR.\n    -s, --squash-commits      Set to True if you want commits to be squashed.\n    -d, --description TEXT    Path to file to use as the description for the MR.\n    --use-issue-name          If set to True will use information from issue in\n                              branch name, must be in the form #issue-number,\n                              i.e feature/#6.\n    --allow-collaboration     If set to True allow, commits from members who can\n                              merge to the target branch.\n    --help                    Show this message and exit.\n\n\n.. code-block:: bash\n\n    gitlab_auto_mr --private-token $(private_token) --source-branch feature/test --project-id 5 \\\n                    --project-url https://gitlab.com/stegappasaurus/stegappasaurus-app --user-id 5\n\nGitLab CI\n*********\n\n``GITLAB_PRIVATE_TOKEN`` Set a secret variable in your GitLab project with your private token. Name it\nGITLAB_PRIVATE_TOKEN (``CI/CD \u003e Environment Variables``). This is necessary to raise the Merge Request on your behalf.\nMore information `click here \u003chttps://docs.gitlab.com/ee/user/profile/personal_access_tokens.html\u003e`_.\nAn example CI using this can be found\n`here \u003chttps://gitlab.com/hmajid2301/stegappasaurus/blob/a22b7dc80f86b471d8a2eaa7b7eadb7b492c53c7/.gitlab-ci.yml\u003e`_,\nlook for the ``create:merge-request`` job.\n\nAdd the following to your ``.gitlab-ci.yml`` file:\n\n.. code-block:: yaml\n\n  stages:\n    - open\n\n  open_merge_request:\n    image: registry.gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr\n    before_script: [] # We do not need any setup work, let's remove the global one (if any)\n    stage: open\n    script:\n      - gitlab_auto_mr -t master -c WIP -d ./.gitlab/merge_request/merge_request.md -r -s --use-issue-name\n\n\nPredefined Variables\n^^^^^^^^^^^^^^^^^^^^\n\nPlease note some of the arguments can be filled in using environment variables defined during GitLab CI.\nFor more information `click here \u003chttps://docs.gitlab.com/ee/ci/variables/predefined_variables.html\u003e_`.\n\n* If ``--private-token`` is not set the script will look for the ENV variable ``GITLAB_PRIVATE_TOKEN``\n* If ``--source-branch`` is not set the script will look for the ENV variable ``CI_COMMIT_REF_NAME``\n* If ``--project-id`` is not set it will look for for the ENV variable ``CI_PROJECT_ID``\n* If ``--gitlab-url`` is not set it will look for for the ENV variable ``CI_PROJECT_URL``\n* If ``--user-id`` is not set it will look for for the ENV variable ``GITLAB_USER_ID``\n\n\nSetup Development Environment\n=============================\n\n.. code-block:: bash\n\n  git clone git@gitlab.com:gitlab-automation-toolkit/gitlab-auto-mr.git\n  cd gitlab-auto-mr\n  pip install tox\n  make install-venv\n  source .venv/bin/activate\n  make install-dev\n\nChangelog\n=========\n\nYou can find the `changelog here \u003chttps://gitlab.com/gitlab-automation-toolkit/gitlab-auto-mr/blob/master/CHANGELOG.md\u003e`_.\n\nAppendix\n========\n\n- Extra features: `Allsimon \u003chttps://gitlab.com/Allsimon/gitlab-auto-merge-request\u003e`_\n- Forked from: `Tobias L. Maier \u003chttps://gitlab.com/tmaier/gitlab-auto-merge-request\u003e`_\n- Script and idea: `Riccardo Padovani \u003chttps://rpadovani.com\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmajid2301%2Fgitlab-auto-mr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmajid2301%2Fgitlab-auto-mr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmajid2301%2Fgitlab-auto-mr/lists"}