File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,12 @@ jobs:
1515 ACTOR : ${{ github.triggering_actor }}
1616 REPO : ${{ github.repository }}
1717 run : |
18- PERMISSION =$(gh api "repos/$REPO/collaborators/$ACTOR/permission" --jq '.permission ')
19- echo "Permission level for $ACTOR: $PERMISSION "
18+ HAS_MAINTAIN =$(gh api "repos/$REPO/collaborators/$ACTOR/permission" --jq '.user.permissions.maintain ')
19+ echo "Maintain permission for $ACTOR: $HAS_MAINTAIN "
2020
21- case "$PERMISSION" in
22- maintain|admin)
23- echo "Access granted: $ACTOR has '$PERMISSION' permission."
24- ;;
25- *)
26- echo "Access denied: $ACTOR has '$PERMISSION' permission, but 'maintain' or higher is required."
27- exit 1
28- ;;
29- esac
21+ if [ "$HAS_MAINTAIN" = "true" ]; then
22+ echo "Access granted: $ACTOR has maintain permission."
23+ else
24+ echo "Access denied: $ACTOR does not have maintain permission."
25+ exit 1
26+ fi
You can’t perform that action at this time.
0 commit comments