File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,17 +22,19 @@ jobs:
2222 app-id : ${{ secrets.APP_ID }}
2323 private-key : ${{ secrets.APP_PRIVATE_KEY }}
2424 owner : blacklanternsecurity
25- repositories : CLA
2625
2726 - name : Check org membership
2827 id : membership
28+ env :
29+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
2930 run : |
3031 if [ "${{ github.event_name }}" = "pull_request_target" ]; then
31- ASSOC ="${{ github.event.pull_request.author_association }}"
32+ AUTHOR ="${{ github.event.pull_request.user.login }}"
3233 else
33- ASSOC="${{ github.event.issue.author_association }}"
34+ PR_NUM="${{ github.event.issue.number }}"
35+ AUTHOR=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUM" --jq '.user.login' 2>/dev/null)
3436 fi
35- if [ "$ASSOC" = "MEMBER" ] || [ "$ASSOC" = "OWNER" ] || [ "$ASSOC" = "COLLABORATOR" ] ; then
37+ if [ -n "$AUTHOR" ] && gh api "orgs/blacklanternsecurity/members/$AUTHOR" > /dev/null 2>&1 ; then
3638 echo "is_member=true" >> "$GITHUB_OUTPUT"
3739 else
3840 echo "is_member=false" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments