How to create a manual approval process in Gitlab pipeline

I am using Free tier and trying to explore this use case:

  • 2 Repo : Dev_Local_Copy, Master_Branch
  • GitLab pipeline - Commit a change into Master_Branch triggers build, deploy, test (This is already done and works fine)

Requirement

  • When Developer pushes changes to Master_Branch, we would like to bring Manual approval process to review the code changes.
  • As a Reviewer, I would like to see an option to accept or reject
    • When Accept is selected , an email notification to required people
    • Pipeline should continue the flow (build, deploy, test)
  • When Reject is selected, the pipeline should not flow , an email notification on rejection of changes to list of people

How do we achieve this ? Any response would be helpful? Possible please share the sample YML

Hi @anand_g
Developers should not have permissions to push to Master_Branch.
The functionality you need is already implemented - Merge Request

Thanks for responding. I just quoted an example. Intend of this question to know how to bring manual approval process in GitLab pipeline through YML

I guess you can use manual jobs that someone needs to trigger, but that won’t meet your requirements. Otherwise you can’t do it. Approval processes aren’t be part of automated CI/CD pipelines so there are no explicit features. They are not intended for such use-case. Approval processes already have working and well designed features that are designed for it.

can we use GitLab rules here? like this

stages:

  • Approval
  • calldata
    Approval:
    stage: approval
    script : echo appoval
    action : approve/reject
    tags :
    • ci
      approve:
      stage: approval
      When: approve
      script: echo approve
      tags:
    • ci
      reject:
      stage: approval
      When: reject
      script: echo reject
      tags:
    • ci

Call_data:
stage: calldata
script:
- echo hello
tags:
- ci

There are no action or approve or reject keywords. You can find the full reference to GitLab CI here.