File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,9 +167,12 @@ jobs:
167167 fi
168168
169169 if gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM > /dev/null 2>&1; then
170- gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM/repos/$OWNER/$REPO_NAME \
171- -X PUT -H "Accept: application/vnd.github+json" -f permission=write || \
172- echo "::error::Failed to set permissions for $CODEOWNERS_TEAM. Please check team and repository availability."
170+ echo "Assigning permissions to CODEOWNERS_TEAM: [$CODEOWNERS_TEAM]"
171+ gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM | jq || echo "::warning::Failed to retrieve CODEOWNERS_TEAM info"
172+ gh api orgs/$OWNER/teams | jq '.[] | select(.name | test("codeowners")) | {name, slug}' || echo "::warning::Could not locate CODEOWNERS_TEAM in list"
173+ gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM/repos/$OWNER/$REPO_NAME \
174+ -X PUT -H "Accept: application/vnd.github+json" -f permission=write || \
175+ echo "::error::Failed to set permissions for $CODEOWNERS_TEAM. Please check team and repository availability."
173176 else
174177 echo "::error::Team $CODEOWNERS_TEAM does not exist. Cannot assign permissions."
175178 exit 1
You can’t perform that action at this time.
0 commit comments