mirror of
https://github.com/stride3d/stride.git
synced 2026-10-12 02:23:23 +00:00
ci: enforce release-managers membership (fix no-op permission check)
This commit is contained in:
@@ -42,9 +42,10 @@ jobs:
|
||||
ORG=$(echo "${{ github.repository }}" | cut -d/ -f1)
|
||||
TEAM="stride-release-managers"
|
||||
USER="${{ github.actor }}"
|
||||
STATUS=$(gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>&1 && echo "ok" || echo "fail")
|
||||
if [ "$STATUS" = "fail" ]; then
|
||||
echo "::error::User $USER is not a member of $ORG/$TEAM. Sign/deploy requires stride-release-managers team membership."
|
||||
# A 404 here means either the actor isn't a member OR GH_PAT can't read the team
|
||||
# (dead/under-scoped token); the message covers both since the API can't distinguish them.
|
||||
if ! gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>/dev/null; then
|
||||
echo "::error::Sign/deploy blocked: '$USER' is not a member of $ORG/$TEAM, or GH_PAT cannot read it (dead token / missing Organization Members: Read). Requires stride-release-managers membership."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@ jobs:
|
||||
ORG=$(echo "${{ github.repository }}" | cut -d/ -f1)
|
||||
TEAM="stride-release-managers"
|
||||
USER="${{ github.actor }}"
|
||||
STATUS=$(gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>&1 && echo "ok" || echo "fail")
|
||||
if [ "$STATUS" = "fail" ]; then
|
||||
echo "::error::User $USER is not a member of $ORG/$TEAM. Unlisting requires stride-release-managers team membership."
|
||||
# A 404 here means either the actor isn't a member OR GH_PAT can't read the team
|
||||
# (dead/under-scoped token); the message covers both since the API can't distinguish them.
|
||||
if ! gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>/dev/null; then
|
||||
echo "::error::Unlisting blocked: '$USER' is not a member of $ORG/$TEAM, or GH_PAT cannot read it (dead token / missing Organization Members: Read). Requires stride-release-managers membership."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -39,9 +39,10 @@ jobs:
|
||||
ORG=$(echo "${{ github.repository }}" | cut -d/ -f1)
|
||||
TEAM="stride-release-managers"
|
||||
USER="${{ github.actor }}"
|
||||
STATUS=$(gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>&1 && echo "ok" || echo "fail")
|
||||
if [ "$STATUS" = "fail" ]; then
|
||||
echo "::error::User $USER is not a member of $ORG/$TEAM. Sign/deploy requires stride-release-managers team membership."
|
||||
# A 404 here means either the actor isn't a member OR GH_PAT can't read the team
|
||||
# (dead/under-scoped token); the message covers both since the API can't distinguish them.
|
||||
if ! gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>/dev/null; then
|
||||
echo "::error::Sign/deploy blocked: '$USER' is not a member of $ORG/$TEAM, or GH_PAT cannot read it (dead token / missing Organization Members: Read). Requires stride-release-managers membership."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -70,9 +70,10 @@ jobs:
|
||||
ORG=$(echo "${{ github.repository }}" | cut -d/ -f1)
|
||||
TEAM="stride-release-managers"
|
||||
USER="${{ github.actor }}"
|
||||
STATUS=$(gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>&1 && echo "ok" || echo "fail")
|
||||
if [ "$STATUS" = "fail" ]; then
|
||||
echo "::error::User $USER is not a member of $ORG/$TEAM. Sign/deploy requires stride-release-managers team membership."
|
||||
# A 404 here means either the actor isn't a member OR GH_PAT can't read the team
|
||||
# (dead/under-scoped token); the message covers both since the API can't distinguish them.
|
||||
if ! gh api "orgs/$ORG/teams/$TEAM/memberships/$USER" --silent 2>/dev/null; then
|
||||
echo "::error::Sign/deploy blocked: '$USER' is not a member of $ORG/$TEAM, or GH_PAT cannot read it (dead token / missing Organization Members: Read). Requires stride-release-managers membership."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user