Last active
May 6, 2019 15:02
-
-
Save rlanyi/b782e8bc9fd341c03c68bef173682660 to your computer and use it in GitHub Desktop.
Get labels and if they are on group/project level from GitLab
This file contains 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 | |
for group in $(gitlab -o json group list | jq -r .[].id); do for project in $(gitlab -o json group-project list --group-id $group | jq -r .[].id); do path_with_namespace=$(gitlab -o json project get --id $project | jq -r .path_with_namespace) ; tempfile=$(echo $path_with_namespace | sed "s/\//_/g"); echo -e "\nProject: $path_with_namespace ($temppath)" | tee $tempfile; gitlab -o json project-label list --project-id $project | jq -r '.[] | [.name, .is_project_label|tostring] | join(" ")' | tee $tempfile ; done; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment