Skip to content

Commit 53571d1

Browse files
authored
chore: ci (jdf2e#2690)
* chore: use pull request target event * chore: use pull request target event * chore: use pull request target event * chore: use pull request target event * chore: use pull request target event * chore: use pull request target event * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test * chore: ci test
1 parent 5a3e7c3 commit 53571d1

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,39 @@ on:
44
push:
55
branches:
66
- next
7-
7+
- V3.0
88
pull_request:
99
branches:
1010
- next
11-
11+
- V3.0
12+
pull_request_target:
13+
types: [opened, synchronize, reopened]
1214
workflow_dispatch:
1315

16+
permissions: write-all
17+
1418
jobs:
15-
label:
19+
add-label:
1620
runs-on: ubuntu-latest
1721

1822
steps:
19-
- name: Check out the repository
23+
- name: Check out repository
2024
uses: actions/checkout@v4
2125

22-
- name: Determine label
23-
id: determine_label
26+
- name: Determine label based on target branch
27+
id: determine-label
2428
run: |
29+
echo "${{github.event_name}}"
2530
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
2631
echo "label=2.x" >> $GITHUB_ENV
2732
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
2833
echo "label=3.x" >> $GITHUB_ENV
34+
else
35+
echo "label=" >> $GITHUB_ENV
2936
fi
3037
31-
- name: Add label to PR
38+
- name: Add label to Pull Request
39+
if: github.event_name == 'pull_request_target' && env.label != ''
3240
uses: actions-ecosystem/action-add-labels@v1
3341
with:
3442
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)