Skip to content
Snippets Groups Projects

Gitlab & Github scripts

Open Tiago Lucas requested to merge tiagolucas/scripts:main into main
Files
6
@@ -74,11 +74,6 @@ fi
@@ -74,11 +74,6 @@ fi
shift $((OPTIND-1))
shift $((OPTIND-1))
if [[ -z "${GH_TOKEN:-}" ]]; then
read -p "Enter your GitHub token: " -r GH_TOKEN
export GH_TOKEN
fi
command -v gh >/dev/null 2>&1 || {
command -v gh >/dev/null 2>&1 || {
echo >&2 "This script requires the GitHub CLI tool (gh), but it's not installed."
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 "Please download and install it from https://github.com/cli/cli."
@@ -86,6 +81,11 @@ command -v gh >/dev/null 2>&1 || {
@@ -86,6 +81,11 @@ command -v gh >/dev/null 2>&1 || {
exit 1
exit 1
}
}
 
if [[ -z "${GH_TOKEN:-}" && $(gh auth status 2>/dev/null | grep -c 'account: true') -lt 1 ]]; then
 
read -p "Enter your GitHub token: " -r GH_TOKEN
 
export GH_TOKEN
 
fi
 
case $ACTION in
case $ACTION in
"list-active") list_active_membership ;;
"list-active") list_active_membership ;;
"list-pending") list_pending_membership ;;
"list-pending") list_pending_membership ;;
Loading