Skip to content

Commit b8f5376

Browse files
Update scripts/create-enterprise-team-tied-to-idp-group.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 47fa8b3 commit b8f5376

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scripts/create-enterprise-team-tied-to-idp-group.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,30 @@ IDP_GROUP=$3 # IdP group display name to search for
3838
API=${4:-"https://api.github.com"} # GitHub API base URL (optional, defaults to github.com)
3939

4040
# --- Input validation ---
41-
if [ -z "$3" ]; then
41+
if [ "$#" -lt 3 ]; then
4242
echo "Usage: $0 <enterprise> <team-name> <idp-group-name> [api-url]"
4343
echo ""
4444
echo "Example: $0 fabrikam MyTeam \"Engineering Team\""
4545
exit 1
4646
fi
4747

48+
if [ -z "$ENTERPRISE" ]; then
49+
echo "Error: enterprise slug (first argument) must not be empty."
50+
echo "Usage: $0 <enterprise> <team-name> <idp-group-name> [api-url]"
51+
exit 1
52+
fi
53+
54+
if [ -z "$TEAM" ]; then
55+
echo "Error: team name (second argument) must not be empty."
56+
echo "Usage: $0 <enterprise> <team-name> <idp-group-name> [api-url]"
57+
exit 1
58+
fi
59+
60+
if [ -z "$IDP_GROUP" ]; then
61+
echo "Error: IdP group name (third argument) must not be empty."
62+
echo "Usage: $0 <enterprise> <team-name> <idp-group-name> [api-url]"
63+
exit 1
64+
fi
4865
if [ -z "$GH_PAT" ]; then
4966
echo "Error: GH_PAT environment variable is not set."
5067
echo "Set it with: export GH_PAT=ghp_abc"

0 commit comments

Comments
 (0)