-
Notifications
You must be signed in to change notification settings - Fork 217
32 lines (29 loc) · 1.05 KB
/
tag-issues.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
name: Tag Issues
on:
issues:
types: [opened]
jobs:
tag_issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Apply customer request labels
run: |
USER="${{ github.event.issue.user.login }}"
PRIORITY_USERS=$(echo "${{ secrets.PRIORITY_SUPPORT_USERS }}" | cut -d ',' -f1 | tr '\n' ' ')
IS_PRIORITY_USER="false"
for PRIORITY_USER in $PRIORITY_USERS; do
if [[ "$USER" == "$PRIORITY_USER" ]]; then
IS_PRIORITY_USER="true"
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels \
-d '{"labels":["customer request"]}'
break
fi
done
echo "Is priority user: $IS_PRIORITY_USER"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}