File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,12 +26,17 @@ jobs:
2626
2727 - name : Check org membership
2828 id : membership
29- if : github.event_name == 'pull_request_target'
3029 env :
3130 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3231 run : |
33- AUTHOR="${{ github.event.pull_request.user.login }}"
34- if gh api "orgs/blacklanternsecurity/members/$AUTHOR" > /dev/null 2>&1; then
32+ if [ "${{ github.event_name }}" = "pull_request_target" ]; then
33+ AUTHOR="${{ github.event.pull_request.user.login }}"
34+ else
35+ # For issue_comment events, look up the PR author
36+ PR_NUM="${{ github.event.issue.number }}"
37+ AUTHOR=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUM" --jq '.user.login' 2>/dev/null)
38+ fi
39+ if [ -n "$AUTHOR" ] && gh api "orgs/blacklanternsecurity/members/$AUTHOR" > /dev/null 2>&1; then
3540 echo "is_member=true" >> "$GITHUB_OUTPUT"
3641 else
3742 echo "is_member=false" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments