|
1 | 1 | name: "CLA Assistant" |
2 | 2 | on: |
3 | 3 | issue_comment: |
4 | | - types: [created] |
| 4 | + types: [created, edited] |
5 | 5 | pull_request_target: |
6 | 6 | types: [opened,closed,synchronize] |
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | CLAssistant: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | 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 | + |
12 | 35 | - name: "CLA Assistant" |
13 | 36 | 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' |
14 | 37 | uses: contributor-assistant/[email protected] |
15 | 38 | env: |
16 | 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
17 | | - PERSONAL_ACCESS_TOKEN : ${{ secrets.REPO_SCOPE }} |
| 40 | + PERSONAL_ACCESS_TOKEN: ${{ secrets.REPO_SCOPE }} |
18 | 41 | 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