08月22, 2019

通过脚本提交merge request

// merge.sh

#!/usr/bin/env bash


# Look which is the default branch
TARGET_BRANCH="master";

HOST="https://test.xxx.com/api/v4/projects/"

PROJECT_ID="111111"

# The description of our new MR, we want to remove the branch after the MR has
# been closed
BODY="{
    \"id\": ${PROJECT_ID},
    \"source_branch\": \"feature-deploy-fby\",
    \"target_branch\": \"master\",
    \"remove_source_branch\": true,
    \"title\": \"这是一个机器发的merge request\",
    \"assignee_id\":\"\"
}";

curl -X POST "${HOST}${PROJECT_ID}/merge_requests" \
        --header "PRIVATE-TOKEN:this_is_my_private_token" \
        --header "Content-Type: application/json" \
        --data "${BODY}";

echo "Opened a new merge request: WIP: feature-new@0822 and assigned to you";

本文链接:http://fengbaiyang.cn/post/git-merge-request-script.html

-- EOF --

Comments

暂不支持评论,如有问题,请发邮件至baiyang.feng@outlook.com。 望不吝赐教~