Created
November 18, 2023 05:31
-
-
Save apeckham/6a34ce36672935a392fd4655c1c7fa29 to your computer and use it in GitHub Desktop.
delete gitlab runners for a group
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
#!/usr/bin/env bash | |
set -ex | |
curl -s --fail --header "Private-Token: $GITLAB_TOKEN" "https://gitlab.com/api/v4/groups/$GITLAB_GROUP_ID/runners" | \ | |
jq -r '.[] .id' | \ | |
while read -r runner_id; do | |
echo "Deleting runner: $runner_id" | |
curl --fail --header "Private-Token: $GITLAB_TOKEN" --request DELETE "https://gitlab.com/api/v4/runners/${runner_id}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment