Created
September 24, 2020 07:37
-
-
Save pwo3/21d954419a7baadcb9268ba07b67d913 to your computer and use it in GitHub Desktop.
auto-rebase.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gitlab_base_url=https://gitlab.com/api/v4/projects | |
opened_merge_requests=$(curl -H "Authorization: Bearer $GITLAB_PERSONAL_TOKEN" $gitlab_base_url/"$PROJECT_ID"/merge_requests?state=opened) | |
for iid in $(echo "$opened_merge_requests" | jq '.[] | .iid'); do | |
curl -X PUT -H "Authorization: Bearer $GITLAB_PERSONAL_TOKEN" $gitlab_base_url/"$PROJECT_ID"/merge_requests/"$iid"/rebase | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment