From 22f0ffec854df87afcf2141fd04b4be85e27d5fa Mon Sep 17 00:00:00 2001
From: Frederic Gurr <frederic.gurr@eclipse-foundation.org>
Date: Fri, 26 May 2023 15:47:11 +0000
Subject: [PATCH] Check if GitHub CLI tool is installed

---
 github/github-membership.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/github/github-membership.sh b/github/github-membership.sh
index e56ad34..913bf38 100755
--- a/github/github-membership.sh
+++ b/github/github-membership.sh
@@ -79,6 +79,13 @@ if [[ -z "${GH_TOKEN:-}" ]]; then
   export GH_TOKEN
 fi
 
+command -v gh >/dev/null 2>&1 || { 
+  echo >&2 "This script requires the GitHub CLI tool (gh), but it's not installed."
+  echo >&2 "Please download and install it from https://github.com/cli/cli."
+  echo >&2 "Aborting."
+  exit 1
+}
+
 case $ACTION in
   "list-active") list_active_membership ;;
   "list-pending") list_pending_membership ;;
-- 
GitLab