Skip to content

Commit 62b9f2b

Browse files
committed
update usage of gitlab API: up to 100 items non paginated
1 parent d60756e commit 62b9f2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

get-gitlab-repo.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function usage() {
77

88
# **** Lister les ID des sous-groupes d'un groupe (donné par son ID) : ****
99
function get_subgroups_id() {
10-
echo "$(curl -s --header "PRIVATE-TOKEN: $PRIVATE_TOKEN_API" "https://gitlab.com/api/v4/groups/$1/subgroups" | jq -r ".[].id")"
10+
echo "$(curl -s --header "PRIVATE-TOKEN: $PRIVATE_TOKEN_API" "https://gitlab.com/api/v4/groups/$1/subgroups?per_page=100" | jq -r ".[].id")"
1111
}
1212

1313
# **** Récupérer le nom d'un groupe (donné par son ID) : ****
@@ -17,15 +17,15 @@ function get_groupname() {
1717

1818
# **** Récupérer les URLs des dépots d'un groupe (donné par son ID) : ****
1919
function get_repo_https() {
20-
echo "$(curl -s --header "PRIVATE-TOKEN: $PRIVATE_TOKEN_API" "https://gitlab.com/api/v4/groups/$1" | jq -r ".projects[].http_url_to_repo")"
20+
echo "$(curl -s --header "PRIVATE-TOKEN: $PRIVATE_TOKEN_API" "https://gitlab.com/api/v4/groups/$1?per_page=100" | jq -r ".projects[].http_url_to_repo")"
2121
}
2222

2323
# **** Descends dans l'arbre des groupes et affiche les éléments rencontrés : ***
2424
function process_group() {
2525
echo "$1"
2626
local sg=$(get_subgroups_id $1)
2727
local g=""
28-
28+
2929
for g in $sg
3030
do echo $(process_group $g)
3131
done

0 commit comments

Comments
 (0)