Hello, On Tue 12 Mar 2024 at 12:29pm +01, Aymeric Agon-Rambosson wrote:
> Hi Sean, > > Le mardi 12 mars 2024 à 10:31, Sean Whitton <spwhit...@spwhitton.name> a écrit > : > >> I'd prefer just to unprotect the branches. > > Agreed. > >> Does anyone have a script which mass-unprotects branches? > > I just looked it up, I came up with the following scripts. You need to have > created an API token with the relevant permissions. And the scripts use the > ~jq(1)~ command, installable from the homonymous debian package. > > The attached file ~debian_emacsen_ids_and_branches~ contains the project ids > and the names of the protected branches of the debian-emacsen group. I > generated this list using the scripts ~salsa_fetch_debian_emacsen.sh~ and > ~salsa_list_protected_branches.sh~, which I have included for reference. > > The script ~salsa_unprotect_branches.sh~ does the actual unprotecting. I could > not test it, for I am not the owner (I get 403 errors, which makes sense). > > Here are the relevant gitlab api documentations I used to get to this : > https://docs.gitlab.com/ee/api/groups.html and > https://docs.gitlab.com/ee/api/protected_branches.html. > > Do tell me how it worked, I am curious. Xiyue reports it worked :) -- Sean Whitton
signature.asc
Description: PGP signature