File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,25 @@ jobs:
157
157
- name : Set team permissions
158
158
run : |
159
159
if gh api orgs/$OWNER/teams > /dev/null 2>&1; then
160
- gh api orgs/$OWNER/teams/$MAINTAINERS_TEAM/repos/$OWNER/$REPO_NAME -X PUT -f permission=triage
161
- gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM/repos/$OWNER/$REPO_NAME -X PUT -f permission=write
162
- gh api orgs/$OWNER/teams/admins/repos/$OWNER/$REPO_NAME -X PUT -f permission=maintain
160
+ if gh api orgs/$OWNER/teams/$MAINTAINERS_TEAM > /dev/null 2>&1; then
161
+ gh api orgs/$OWNER/teams/$MAINTAINERS_TEAM/repos/$OWNER/$REPO_NAME \
162
+ -X PUT -H "Accept: application/vnd.github+json" -f permission=triage || \
163
+ echo "::error::Failed to set permissions for $MAINTAINERS_TEAM. Please check team and repository availability."
164
+ else
165
+ echo "::error::Team $MAINTAINERS_TEAM does not exist. Cannot assign permissions."
166
+ exit 1
167
+ fi
168
+ if gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM > /dev/null 2>&1; then
169
+ gh api orgs/$OWNER/teams/$CODEOWNERS_TEAM/repos/$OWNER/$REPO_NAME \
170
+ -X PUT -H "Accept: application/vnd.github+json" -f permission=write || \
171
+ echo "::error::Failed to set permissions for $CODEOWNERS_TEAM. Please check team and repository availability."
172
+ else
173
+ echo "::error::Team $CODEOWNERS_TEAM does not exist. Cannot assign permissions."
174
+ exit 1
175
+ fi
176
+ gh api orgs/$OWNER/teams/admins/repos/$OWNER/$REPO_NAME \
177
+ -X PUT -H "Accept: application/vnd.github+json" -f permission=maintain || \
178
+ echo "::error::Failed to set permissions for admin team. Please check team and repository availability."
163
179
else
164
180
echo "Skipping team permission assignment — not running in an organization."
165
181
fi
You can’t perform that action at this time.
0 commit comments