Coder Social home page Coder Social logo

orion0616 / gitlab-merge-request-resource-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samcontesse/gitlab-merge-request-resource

0.0 1.0 0.0 49 KB

A concourse resource to check for new merge requests on GitLab

Go 97.35% Shell 0.85% Dockerfile 1.80%

gitlab-merge-request-resource-1's Introduction

GitLab Merge Request Concourse Resource

A concourse resource to check for new merge requests on GitLab and update the merge request status.

Source Configuration

resource_types:
- name: merge-request
  type: docker-image
  source:
    repository: samcontesse/gitlab-merge-request-resource

resources:
- name: merge-request
  type: merge-request
  source:
    uri: https://gitlab.com/myname/myproject.git
    private_token: XXX
  • uri: (required) The location of the repository (required)
  • private_token: (required) Your GitLab user's private token (required, can be found in your profile settings)
  • insecure: When set to true, SSL verification is turned off
  • skip_work_in_progress: When set to true, merge requests mark as work in progress (WIP) will be skipped. Default false
  • skip_not_mergeable: When set to true, merge requests not marked as mergeable will be skipped. Default false
  • skip_trigger_comment: When set to true, the resource will not look up for [trigger ci] merge request comments to manually trigger builds. Default false
  • concourse_url: When set, this url will be used to override ATC_EXTERNAL_URL during commit status updates. No set default.
  • pipeline_name(string): When set, this url will be used to override BUILD_PIPELINE_NAME during commit status updates.
  • labels(string[]): Filter merge requests by label[]
  • target_branch(string): Filter merge requests by target_branch. Default is empty string.

Behavior

check: Check for new merge requests

Checks if there are new merge requests or merge requests with new commits.

in: Clone merge request source branch

git clones the source branch of the respective merge request.

out: Update a merge request's merge status

Updates the merge request's merge_status which displays nicely in the GitLab UI and allows to only merge changes if they pass the test.

Parameters

  • repository: The path of the repository of the merge request's source branch (required)
  • status: The new status of the merge request (required, can be either pending, running, success, failed, or canceled)
  • labels(string[]): The labels you want add to your merge request
  • comment: Add a comment for MR. Could be an object with text/file fields. If just the file or text is specified it is used to populate the field, if both file and text are specified then the file is substituted in to replace $FILE_CONTENT in the text.

Example

jobs:
- name: sample-merge-request
  plan:
  - get: merge-request
    trigger: true
  - put: merge-request
    params:
      repository: merge-request
      status: running
  - task: unit-test
    file: merge-request/ci/tasks/unit-test.yml
  on_failure:
    put: merge-request
    params:
      repository: merge-request
      status: failed
  on_success:
    put: merge-request
    params:
      repository: merge-request
      status: success
      labels: ['unit-test', 'stage']
      comment:
        file: out/commt.txt
        text: |
          Add new comment.
          $FILE_CONTENT

gitlab-merge-request-resource-1's People

Contributors

simonxming avatar samcontesse avatar orion0616 avatar

Watchers

James Cloos avatar

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.