-
Notifications
You must be signed in to change notification settings - Fork 66
46 lines (40 loc) 路 1.15 KB
/
community-label-user-requests.yaml
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
40
41
42
43
44
45
46
# Label PRs and issues created by users that are not part
# of the tracetest team.
on:
issues:
types:
- opened
permissions:
id-token: write
contents: read
issues: write
pull-requests: write
jobs:
notify_slack:
name: Label user request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load team members
id: load_team_members
run:
echo "team_members=$(cat .github/TEAM_MEMBERS.txt | tr '\n' ',')" >> $GITHUB_OUTPUT
- name: Check if it's team member
id: is_team_member
if: github.event.action == 'opened'
uses: mathnogueira/user-blocklist@1.0.0
with:
blocked_users: ${{ steps.load_team_members.outputs.team_members }}
- name: Label issue
if: |
steps.is_team_member.outputs.result == 'false'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['user-request']
})