Skip to content

Commit feaf370

Browse files
dsp-antclaude
andcommitted
Support subteam membership for @claude access
Check if user is a member of steering-committee team directly OR any of its subteams. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 604a3c9 commit feaf370

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/claude.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,27 @@ jobs:
2727
steps:
2828
- name: Check team membership
2929
run: |
30-
# Check if user is member of steering-committee team
30+
# Check if user is member of steering-committee team or any of its subteams
3131
TEAM_SLUG="steering-committee"
32-
RESPONSE=$(gh api "orgs/modelcontextprotocol/teams/${TEAM_SLUG}/memberships/${{ github.actor }}" 2>&1)
32+
ACTOR="${{ github.actor }}"
3333
34-
if echo "$RESPONSE" | grep -q '"state": "active"'; then
35-
echo "✓ User is a member of $TEAM_SLUG team"
34+
# Check direct membership in steering-committee
35+
if gh api "orgs/modelcontextprotocol/teams/${TEAM_SLUG}/memberships/${ACTOR}" 2>/dev/null | grep -q '"state": "active"'; then
36+
echo "✓ User is a direct member of $TEAM_SLUG team"
3637
exit 0
37-
else
38-
echo "✗ User is not a member of $TEAM_SLUG team or its subteams"
39-
exit 1
4038
fi
39+
40+
# Check membership in subteams
41+
SUBTEAMS=$(gh api "orgs/modelcontextprotocol/teams/${TEAM_SLUG}/teams" --paginate -q '.[].slug' 2>/dev/null)
42+
for subteam in $SUBTEAMS; do
43+
if gh api "orgs/modelcontextprotocol/teams/${subteam}/memberships/${ACTOR}" 2>/dev/null | grep -q '"state": "active"'; then
44+
echo "✓ User is a member of $subteam subteam"
45+
exit 0
46+
fi
47+
done
48+
49+
echo "✗ User is not a member of $TEAM_SLUG team or any of its subteams"
50+
exit 1
4151
env:
4252
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4353

0 commit comments

Comments
 (0)