Skip to content

Commit 5f4762a

Browse files
juggernot325ddlees
andauthored
BED-5922 CLA Assistant changes (#216)
* chore: Update CLA Assistant to point to new repo in SpecterOps org * feat: grab list of org members prior to running CLA assistant. Don't include the members in the CLA check --------- Co-authored-by: Dillon Lees <[email protected]>
1 parent 00d8bce commit 5f4762a

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

.github/workflows/cla.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
11
name: "CLA Assistant"
22
on:
33
issue_comment:
4-
types: [created]
4+
types: [created, edited]
55
pull_request_target:
66
types: [opened,closed,synchronize]
77

88
jobs:
99
CLAssistant:
1010
runs-on: ubuntu-latest
1111
steps:
12+
- name: "Organization Members"
13+
id: org-members
14+
run: |
15+
ALL_MEMBERS=""
16+
URL="${{ github.api_url }}/orgs/${{ github.repository_owner }}/members?per_page=100"
17+
18+
while [ -n "$URL" ]; do
19+
MEMBERS=$(curl -s -D headers.txt -H "Authorization: Bearer ${{ secrets.READ_MEMBERS_SCOPE }}" "$URL" | jq -r '[.[] | .login] | join(",")')
20+
URL=$(grep -i '^Link:' headers.txt | sed -n 's/.*<\(.*\)>; rel="next".*/\1/p' || true)
21+
rm -f headers.txt
22+
23+
if [ -n "$MEMBERS" ]; then
24+
if [ -z "$ALL_MEMBERS" ]; then
25+
ALL_MEMBERS="$MEMBERS"
26+
else
27+
ALL_MEMBERS="$ALL_MEMBERS,$MEMBERS"
28+
fi
29+
fi
30+
done
31+
32+
echo "::add-mask::$ALL_MEMBERS"
33+
echo "org_members=$ALL_MEMBERS" >> $GITHUB_OUTPUT
34+
1235
- name: "CLA Assistant"
1336
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'
1437
uses: contributor-assistant/[email protected]
1538
env:
1639
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17-
PERSONAL_ACCESS_TOKEN : ${{ secrets.REPO_SCOPE }}
40+
PERSONAL_ACCESS_TOKEN: ${{ secrets.REPO_SCOPE }}
1841
with:
19-
path-to-signatures: 'signatures.json'
20-
path-to-document: 'https://github.com/BloodHoundAD/CLA/blob/main/ICLA.md'
21-
branch: 'main'
22-
remote-organization-name: BloodHoundAD
23-
remote-repository-name: CLA
42+
path-to-signatures: "signatures.json"
43+
path-to-document: "https://github.com/SpecterOps/CLA/blob/main/ICLA.md"
44+
branch: "main"
45+
remote-organization-name: SpecterOps
46+
remote-repository-name: CLA
47+
allowlist: ${{ steps.org-members.outputs.org_members }}

0 commit comments

Comments
 (0)