Skip to content

Commit cde1771

Browse files
chore: update team membership check
1 parent e28360d commit cde1771

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/scripts/check_team_membership.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,29 @@ set -x
44

55
USER=$1
66

7-
response=$(gh api \
7+
# Check membership for the sdk team
8+
sdk_response=$(gh api \
89
-H "Accept: application/vnd.github+json" \
910
-H "X-GitHub-Api-Version: 2022-11-28" \
1011
"/orgs/immutable/teams/sdk/memberships/${USER}")
1112

12-
echo "$response"
13+
# Check membership for the passport team
14+
passport_response=$(gh api \
15+
-H "Accept: application/vnd.github+json" \
16+
-H "X-GitHub-Api-Version: 2022-11-28" \
17+
"/orgs/immutable/teams/passport/memberships/${USER}")
1318

14-
if echo "$response" | grep -q '"state":"active"'; then
19+
echo "SDK Response: $sdk_response"
20+
echo "Passport Response: $passport_response"
21+
22+
# Check if the user is a member of either team
23+
if echo "$sdk_response" | grep -q '"state":"active"' || echo "$passport_response" | grep -q '"state":"active"'; then
1524
IS_MEMBER=true
1625
else
1726
IS_MEMBER=false
1827
fi
28+
1929
echo "$IS_MEMBER"
2030

2131
# Set the environment variable for the GitHub workflow
22-
echo "IS_MEMBER=$IS_MEMBER" >> "$GITHUB_ENV"
32+
echo "IS_MEMBER=$IS_MEMBER" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)