File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 EVENT_ACTION : ${{ github.event.action }}
2929 USER : ${{ github.event.pull_request.user.login || github.actor }}
3030 ACTOR : ${{ github.actor }}
31+ ASSOCIATION : ${{ github.event.pull_request.author_association }}
3132 REPOSITORY : ${{ github.repository }}
3233 run : |
3334 set -euo pipefail
@@ -44,14 +45,18 @@ jobs:
4445 [ "$EVENT_NAME" = "schedule" ] && allow "Scheduled run."
4546
4647 USER_PERM=$(perm "$USER")
47- echo "executor=$USER permission=$USER_PERM"
48+ echo "executor=$USER permission=$USER_PERM association=${ASSOCIATION:-none} "
4849 if [ "$USER_PERM" = "admin" ] || [ "$USER_PERM" = "write" ]; then
4950 allow "$USER is an owner or developer."
5051 fi
52+ # Org members often only have read on this repo, so perm() is not enough.
53+ if [ "$ASSOCIATION" = "OWNER" ] || [ "$ASSOCIATION" = "MEMBER" ]; then
54+ allow "$USER is an organization $ASSOCIATION."
55+ fi
5156
5257 # ok-to-test only counts on the labeled event, so a later push cannot
5358 # reuse an old owner approval against a new PR head.
54- [ "$EVENT_ACTION" = "labeled" ] || deny "$USER is not an owner or developer."
59+ [ "$EVENT_ACTION" = "labeled" ] || deny "$USER is not an owner, member, or developer."
5560
5661 LABELER_PERM=$(perm "$ACTOR")
5762 echo "ok-to-test labeler=$ACTOR permission=$LABELER_PERM"
You can’t perform that action at this time.
0 commit comments