Skip to content

Commit 251ac3a

Browse files
committed
ci: use dynamic org membership check for CLA
1 parent eb41fe3 commit 251ac3a

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/cla.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,23 @@ jobs:
2424
owner: blacklanternsecurity
2525
repositories: CLA
2626

27+
- name: Check org membership
28+
id: membership
29+
if: github.event_name == 'pull_request_target'
30+
env:
31+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
32+
run: |
33+
AUTHOR="${{ github.event.pull_request.user.login }}"
34+
if gh api "orgs/blacklanternsecurity/members/$AUTHOR" > /dev/null 2>&1; then
35+
echo "is_member=true" >> "$GITHUB_OUTPUT"
36+
else
37+
echo "is_member=false" >> "$GITHUB_OUTPUT"
38+
fi
39+
2740
- name: "CLA Assistant"
28-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
41+
if: |
42+
(steps.membership.outputs.is_member != 'true') &&
43+
((github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target')
2944
uses: contributor-assistant/github-action@v2.6.1
3045
env:
3146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -34,6 +49,6 @@ jobs:
3449
path-to-signatures: "signatures/version1/cla.json"
3550
path-to-document: "https://github.com/blacklanternsecurity/CLA/blob/main/ICLA.md"
3651
branch: "main"
37-
allowlist: "dependabot[bot],github-actions[bot],renovate[bot],aconite33,adeemm,ausmaster,bbot-deploy,blsaccess,blscode,en0f,GabKodes,holsick,jackpas23,kerrymilan,kevinoriley,liquidsec,lunarcowboy,MarcusAmes,Mercury0,MrBlackout20,Nasaltron,oversiemulated,pentestpop,pjhartlieb,RReski,shart123456,SpamFaux,stryker2k2,Sw3d1shPh1sh,TheFunky1Markimark,theo2612,TheTechromancer,TMDeal"
52+
allowlist: "dependabot[bot],github-actions[bot],renovate[bot]"
3853
remote-organization-name: "blacklanternsecurity"
3954
remote-repository-name: "CLA"

0 commit comments

Comments
 (0)