#!/usr/bin/env bash
set -euo pipefail

curl --request GET \
  --header "PRIVATE-TOKEN: $SELF_GITLAB_TOKEN" \
  "https://gitlab.ellisbs.co.uk/api/v4/projects" |
  jq -r '.[] | select(.id) | "\(.id) \(.name)"' |
  while read -r project_id project_name_unused; do
    # shellcheck disable=SC2034
    : "$project_name_unused"
    echo "$project_id"
  done
