-
Notifications
You must be signed in to change notification settings - Fork 262
39 lines (37 loc) · 1.24 KB
/
community-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Is Community User Check
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
jobs:
check-is-community:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
env:
SI_STAFF: "adamhjk mahirl fnichol nickgerace jhelwig vbustamante zacharyhamm wendybujalski stack72 britmyerss sprutton1 keeb johnrwatson jobelenus jkeiser"
steps:
- name: Checkout code
id: check_author
run: |
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
if ! [[ "${SI_STAFF}" =~ $PR_AUTHOR ]]; then
echo "Authored by one of our amazing community peeps!"
echo "requires-community-tag=true" >> "$GITHUB_OUTPUT"
else
echo "Successfully checked the author against the staff list"
fi
- name: Label PR
if: steps.check_author.outputs.requires-community-tag == 'true'
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
labels: ['community']
});