Skip to content

Commit 2f5d343

Browse files
authored
Update setup-new-repo.yml
1 parent 6cccd91 commit 2f5d343

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/setup-new-repo.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ jobs:
6767
run: |
6868
if gh api orgs/$OWNER/teams > /dev/null 2>&1; then
6969
if ! gh api orgs/$OWNER/teams/$MAINTAINERS_TEAM > /dev/null 2>&1; then
70-
gh api orgs/$OWNER/teams -f name="$MAINTAINERS_TEAM" -f parent_team_id="maintainers"
70+
MAINTAINERS_PARENT_ID=$(gh api orgs/$OWNER/teams/maintainers | jq -r '.id')
71+
gh api orgs/$OWNER/teams -f name="$MAINTAINERS_TEAM" -f parent_team_id="$MAINTAINERS_PARENT_ID"
7172
else
7273
echo "Team $MAINTAINERS_TEAM already exists. Skipping creation."
7374
fi
7475
7576
if ! gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM > /dev/null 2>&1; then
76-
gh api orgs/$OWNER/teams -f name="$CODEOWNERS_TEAM" -f parent_team_id="codeowners"
77+
CODEOWNERS_PARENT_ID=$(gh api orgs/$OWNER/teams/codeowners | jq -r '.id')
78+
gh api orgs/$OWNER/teams -f name="$CODEOWNERS_TEAM" -f parent_team_id="$CODEOWNERS_PARENT_ID"
7779
else
7880
echo "Team $CODEOWNERS_TEAM already exists. Skipping creation."
7981
fi

0 commit comments

Comments
 (0)