Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

gitlab ci run pipeline only when new merge request created

Gitlab CI only run on Merge Request
To configure pipelines for merge requests, 
add the only: [merge_requests] parameter to 
the jobs that you want to run only for merge requests. 
Then, when developers create or update merge requests, 
a pipeline runs every time a commit is pushed to GitLab.
Comment

merge when pipeline succeeds gitlab

enable_merge:
  only: [merge_requests]
  script:
    - echo true
Comment

run a pipeline when merge request was created on gitlab

workflow:
    rules:
        - if: $CI_PIPELINE_SOURCE == "merge_request_event"
        - if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"

job1:
  script:
    - echo "This job runs in merge request and also after merge to main branch"
Comment

GitLab - Merge When Pipeline Succeeds

# mwps BRANCHNAME
alias mwps='git push -u origin -o merge_request.create -o merge_request.target=main -o merge_request.merge_when_pipeline_succeeds'
Comment

PREVIOUS NEXT
Code Example
Shell :: Start rc.local manually 
Shell :: commit and push 
Shell :: download composer version 1.6.5 
Shell :: git submodule 
Shell :: waiting for your editor to close the file 
Shell :: git list files with size 
Shell :: immutable byte ssh 
Shell :: how to add this package include: package:flutter_lints/flutter.yaml 
Shell :: ubuntu absolute path of file 
Shell :: sed extract string between two patterns 
Shell :: git move file 
Shell :: cache clear env prod symfony 3.4 
Shell :: get code back after hard reset 
Shell :: branch conflicts 
Shell :: how delete wireless connection raspberry pi terminal 
Shell :: reinstall settings app ubuntu 
Shell :: how to exit root user in linux 
Shell :: sudo !! alias 
Shell :: git diff without change mode 
Shell :: check redis server status 
Shell :: create github repo with curl 
Shell :: linux find partial name 
Shell :: chsh pam authentication failure 
Shell :: check iptables rules in kubernetes service 
Shell :: deploy on heroku 
Shell :: batch file path 
Shell :: add directory to path on linux 
Shell :: git delete commit 4785cd1e041 
Shell :: git log with date and author info 
Shell :: extract every nth line using sed linux fedora 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =