diff --git a/createMR.py b/createMR.py index 699c2ac..7026c71 100644 --- a/createMR.py +++ b/createMR.py @@ -47,7 +47,7 @@ else: OWNER, REPO, body=CreatePullRequestOption( - base=branchName, head="main", title="merge" + branchName + base="main", head=branchName, title="merge-" + branchName ), client=client, ).content diff --git a/createMR.sh b/createMR.sh deleted file mode 100644 index d7da326..0000000 --- a/createMR.sh +++ /dev/null @@ -1,79 +0,0 @@ -source './.env' - -PASSED_ISSUE='' - -while test $# -gt 0; do - case "$1" in - -i|--issue) - shift - if test $# -gt 0 - then - export PASSED_ISSUE=$1 - fi - shift - ;; - -h|--help) print_usage ;; - *) print_usage - break - ;; - esac -done - -if [[ -z $PASSED_ISSUE ]] -then - echo -e "missing issue; use -i \e[3missue\e[0m" - exit 1 -fi - -printf "\n" - -ISSUES=$(curl -X 'GET' \ - 'https://git.n39.eu/api/v1/repos/'$OWNER'/'$REPO'/issues' \ - -H 'accept: application/json' | tr ' ' -) - -printf "\n" -echo $ISSUES - -ISSUE=$(jq '.[] | select(.title|test("'$PASSED_ISSUE'"))' <<< $ISSUES) - -printf "\n" -echo $ISSUE - -NAME=$(jq '.title' <<< $ISSUE) - -printf "\n" -echo $NAME - -BRANCH=$(curl -X 'POST' 'https://git.n39.eu/api/v1/repos/'$OWNER'/'$REPO'/branches' \ - -H "accept: application/json" \ - -H 'Authorization: token '${FORJEGO_ACCESS_TOKEN} \ - -H "Content-Type: application/json" -d '{"new_branch_name": '$NAME', "old_branch_name": "main"}' -i) - -echo $BRANCH - -USER=$(git config --global user.name) - -MR=$(curl -X 'POST' 'https://git.n39.eu/api/v1/repos/'$OWNER'/'$REPO'/pulls' \ - -H "accept: application/json" \ - -H 'Authorization: token '${FORJEGO_ACCESS_TOKEN} \ - -H "Content-Type: application/json" -d '{ - "assignee": "'$USER'", - "assignees": [ - "string" - ], - "base": "string", - "body": "string", - "head": "string", - "labels": [ - 0 - ], - "milestone": 0, - "title": "string" - }' -i) - -USER=$(git checkout $BRANCH) - - -#git browse -- issues -#git checkout -b '' -#git push -o merge_request.create origin my-branch \ No newline at end of file