5
5
branches :
6
6
- next
7
7
- V3.0
8
- pull_request :
9
- branches :
10
- - next
11
- - V3.0
12
8
pull_request_target :
13
9
types : [opened, synchronize, reopened]
14
10
workflow_dispatch :
15
11
16
- permissions : write-all
17
-
18
12
jobs :
19
- add-label :
20
- runs-on : ubuntu-latest
21
-
22
- steps :
23
- - name : Check out repository
24
- uses : actions/checkout@v4
25
-
26
- - name : Determine label based on target branch
27
- id : determine-label
28
- run : |
29
- echo "${{github.event_name}}"
30
- if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
31
- echo "label=2.x" >> $GITHUB_ENV
32
- elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
33
- echo "label=3.x" >> $GITHUB_ENV
34
- else
35
- echo "label=" >> $GITHUB_ENV
36
- fi
37
-
38
- - name : Add label to Pull Request
39
- if : github.event_name == 'pull_request_target' && env.label != ''
40
- uses : actions-ecosystem/action-add-labels@v1
41
- with :
42
- github_token : ${{ secrets.GITHUB_TOKEN }}
43
- labels : ${{ env.label }}
44
13
lint :
45
14
runs-on : ubuntu-latest
46
15
steps :
@@ -112,3 +81,29 @@ jobs:
112
81
113
82
- name : Build NutUI-React Taro H5 Demo
114
83
run : npm run build:taro:site
84
+
85
+ add-label :
86
+ runs-on : ubuntu-latest
87
+
88
+ steps :
89
+ - name : Check out repository
90
+ uses : actions/checkout@v4
91
+
92
+ - name : Determine label based on target branch
93
+ id : determine-label
94
+ run : |
95
+ echo "${{github.event_name}}"
96
+ if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
97
+ echo "label=2.x" >> $GITHUB_ENV
98
+ elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
99
+ echo "label=3.x" >> $GITHUB_ENV
100
+ else
101
+ echo "label=" >> $GITHUB_ENV
102
+ fi
103
+
104
+ - name : Add label to Pull Request
105
+ if : env.label != ''
106
+ uses : actions-ecosystem/action-add-labels@v1
107
+ with :
108
+ github_token : ${{ secrets.GITHUB_TOKEN }}
109
+ labels : ${{ env.label }}
0 commit comments