Last active
March 28, 2025 16:48
-
-
Save nickboldt/f79e251794a80c4e82910743b826f96b to your computer and use it in GitHub Desktop.
delete GL MR comments (notes)
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
# for a given merge_request, delete its comments (notes): | |
# this will make reading the information in a MR much easier | |
# as you won't have dozens of Kfux comments to scroll past and ignore | |
GL_API_TOKEN="your token here" | |
PROJECT="rhidp%2Frhdh" # or "rhidp%2Frhdh-plugin-catalog" | |
MR=197 | |
for page in 1 2 3 4; do | |
for id in $(curl --request GET --header "PRIVATE-TOKEN: $GL_API_TOKEN" \ | |
--url "https://gitlab.cee.redhat.com/api/v4/projects/${PROJECT}/merge_requests/${MR}/notes?sort=desc&page=$page" \ | |
-sS | jq -r '.[].id'); do | |
echo -n "> $id " | |
curl --request DELETE --header "PRIVATE-TOKEN: $GL_API_TOKEN" \ | |
--url "https://gitlab.cee.redhat.com/api/v4/projects/${PROJECT}/merge_requests/${MR}/notes/${id}"; echo | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment