Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created November 18, 2023 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apeckham/6a34ce36672935a392fd4655c1c7fa29 to your computer and use it in GitHub Desktop.
Save apeckham/6a34ce36672935a392fd4655c1c7fa29 to your computer and use it in GitHub Desktop.
delete gitlab runners for a group
#!/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