-
-
Save zengqingfu1442/d2808ce39880000a7e2800a8a0a2bd05 to your computer and use it in GitHub Desktop.
auto-rebase.sh
This file contains hidden or 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