Skip to content

Commit 0ef66e1

Browse files
radofuchsRadovan Fuchs
andauthored
run the e2es for members (lightspeed-core#2457)
Co-authored-by: Radovan Fuchs <rfuchs@rfuchs-thinkpadp1gen7.tpb.csb>
1 parent 3b1da38 commit 0ef66e1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/e2e_authorize.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
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"

0 commit comments

Comments
 (0)