Coder Social home page Coder Social logo

jinlxz / gitlab-auto-merge-request Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tmaier/gitlab-auto-merge-request

0.0 1.0 0.0 20 KB

Tool to automatically open Merge Requests on GitLab (if none exists already)

Home Page: https://gitlab.com/tmaier/gitlab-auto-merge-request

Shell 100.00%

gitlab-auto-merge-request's Introduction

Open GitLab Merge Requests automatically

Docker Automated buil Docker Pulls Gitlab Project

This script is meant to be used in GitLab CI to automatically open Merge Requests for feature branches, if there is none yet.

The script is provided as dedicated docker image to improve maintainability in the future.

It is based on the script and idea of Riccardo Padovani, which he introduced with his blog post How to automatically create new MR on Gitlab with Gitlab CI. Thanks for providing this.

Instructions

1) GITLAB_PRIVATE_TOKEN

Set a secret variable in your GitLab project with your private token. Name it GITLAB_PRIVATE_TOKEN. This is necessary to raise the Merge Request on your behalf.

2) .gitlab-ci.yml

Add the following to your .gitlab-ci.yml file:

stages:
  - openMr
  - otherStages

Open Merge Request:
  image: tmaier/gitlab-auto-merge-request:1
  before_script: [] # We do not need any setup work, let's remove the global one (if any)
  variables:
    GIT_STRATEGY: none # We do not need a clone of the GIT repository to create a Merge Request
  stage: openMr
  only:
    - /^feature\/*/ # We have a very strict naming convention
  script:
    - merge-request.sh # The name of the script

You can see this in action at .gitlab-ci.yml of this project.

Docker images

The images are hosted on Docker Hub.

Two tags are noteworthy:

  • latest: Latest release on master branch of this project
  • 1: Latest stable release of 1.x version (see note on Semantic Versioning below)

This project is managed on GitLab

The GitHub project is only a mirror of the GitLab project.

Please open Issues and Merge Requests at the GitLab project.

Versioning

This project follows Semantic Versioning. Following are defined as APIs according to the spec:

  • How to call this script from .gitlab-ci.yml
  • Required Environment Variables

Following are not considered as API according to the spec:

  • Dockerfile and base image used

Authors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.