-
Notifications
You must be signed in to change notification settings - Fork 98
84 lines (73 loc) · 2.28 KB
/
setup_pr.yml
File metadata and controls
84 lines (73 loc) · 2.28 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Setup PR labels
on:
pull_request_target:
types: [opened, reopened]
permissions: write-all
jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Parsing your PR title for lab number
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
SUB='Лаб.'
for VAR in 1 2 3 4
do
if (echo $TITLE | grep -iqF "$SUB$VAR" )|| (echo $TITLE | grep -iqF "$SUB $VAR"); then
echo "LABEL=Lab $VAR" >> "$GITHUB_ENV"
break
fi
done
for VAR in 6211 6212 6213 6214
do
if (echo $TITLE | grep -iqF "$VAR" ); then
echo "GROUP=$VAR" >> "$GITHUB_ENV"
break
fi
done
- name: Checking your lab number
run: |
if [[ $LABEL == '' ]]; then
echo "Your PR caption is not composed correctly"
exit 1
fi
echo Your number was parsed correctly - ${{ env.LABEL }}
- name: Checking your group number
run: |
if [[ $GROUP == '' ]]; then
echo "Your PR caption is not composed correctly"
exit 1
fi
echo Your group was parsed correctly - ${{ env.GROUP }}
- name: Setting PR labels
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
${{ env.LABEL }}
${{ env.GROUP }}
In progress
- name: Setting reviewer
if: env.GROUP == '6211'
uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3
with:
reviewers: "mxwrlld"
token: ${{ secrets.TOKEN }}
- name: Setting reviewer
if: env.GROUP == '6212'
uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3
with:
reviewers: "mxwrlld"
token: ${{ secrets.TOKEN }}
- name: Setting reviewer
if: env.GROUP == '6213'
uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3
with:
reviewers: "AvtoBBus"
token: ${{ secrets.TOKEN }}
- name: Setting reviewer
if: env.GROUP == '6214'
uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3
with:
reviewers: "AvtoBBus"
token: ${{ secrets.TOKEN }}