diff options
| author | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-11 21:17:31 +0000 |
|---|---|---|
| committer | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-11 21:17:31 +0000 |
| commit | 7ad6c3ec641d0b89d072dc9b32202aebb8ecaf8d (patch) | |
| tree | 5fb6d8efebb4b664c59180f61e975289bbab9388 /utils/autoMergeRequest.sh | |
| parent | 8b88da364f7ba1988532bdfa4ecf09adc5c80ed6 (diff) | |
Remove assorted unused stuff.
Diffstat (limited to 'utils/autoMergeRequest.sh')
| -rwxr-xr-x | utils/autoMergeRequest.sh | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/utils/autoMergeRequest.sh b/utils/autoMergeRequest.sh deleted file mode 100755 index bd33db0ca..000000000 --- a/utils/autoMergeRequest.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# Extract the host where the server is running, and add the URL to the APIs -[[ $HOST =~ ^https?://[^/]+ ]] && HOST="${BASH_REMATCH[0]}/api/v4/projects/" - -# Look which is the default branch -TARGET_BRANCH=`curl --silent "${HOST}${CI_PROJECT_ID}" --header "PRIVATE-TOKEN:${PRIVATE_TOKEN}" | python3 -c "import sys, json; print(json.load(sys.stdin)['default_branch'])"`; - -# The description of our new MR, we want to remove the branch after the MR has -# been closed -BODY="{ - \"id\": ${CI_PROJECT_ID}, - \"source_branch\": \"${CI_COMMIT_REF_NAME}\", - \"target_branch\": \"${TARGET_BRANCH}\", - \"remove_source_branch\": true, - \"title\": \"WIP: ${CI_COMMIT_REF_NAME}\", - \"assignee_id\":\"${GITLAB_USER_ID}\" -}"; - -# Require a list of all the merge request and take a look if there is already -# one with the same source branch -LISTMR=`curl --silent "${HOST}${CI_PROJECT_ID}/merge_requests?state=opened" --header "PRIVATE-TOKEN:${PRIVATE_TOKEN}"`; -COUNTBRANCHES=`echo ${LISTMR} | grep -o "\"source_branch\":\"${CI_COMMIT_REF_NAME}\"" | wc -l`; - -# No MR found, let's create a new one -if [ ${COUNTBRANCHES} -eq "0" ]; then - curl -X POST "${HOST}${CI_PROJECT_ID}/merge_requests" \ - --header "PRIVATE-TOKEN:${PRIVATE_TOKEN}" \ - --header "Content-Type: application/json" \ - --data "${BODY}"; - - echo "Opened a new merge request: WIP: ${CI_COMMIT_REF_NAME} and assigned to you"; - exit; -fi - -echo "No new merge request opened"; |