Skip to content

Instantly share code, notes, and snippets.

@tyrcho
Created August 26, 2019 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyrcho/494597d7c0f27b79d2b41eb1621dab57 to your computer and use it in GitHub Desktop.
Save tyrcho/494597d7c0f27b79d2b41eb1621dab57 to your computer and use it in GitHub Desktop.
Rebase on source branch all open MR for a user in a group
curl \
--header "PRIVATE-TOKEN: $GITLAB_PAT" \
"https://gitlab.com/api/v4/groups/$GROUP_ID/merge_requests?state=opened&scope=all&author_id=$AUTHOR_ID" \
| jq -r '.[] | "\(.project_id) \(.iid)"' \
| while read -r projectid mrid; do
curl -X PUT --header "PRIVATE-TOKEN: $GITLAB_PAT" "https://gitlab.com/api/v4/projects/$projectid/merge_requests/$mrid/rebase"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment