Skip to content

Commit 5fc49ec

Browse files
committed
chore: ci test
1 parent 43994be commit 5fc49ec

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,29 @@ on:
1515

1616
jobs:
1717
add-label:
18-
name: Add Label
1918
runs-on: ubuntu-latest
19+
2020
steps:
21-
- uses: actions/checkout@v2
22-
- uses: christianvuerings/add-labels@v1
21+
- name: Check out repository
22+
uses: actions/checkout@v4
23+
24+
- name: Determine label based on target branch
25+
id: determine-label
26+
run: |
27+
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
28+
echo "label=2.x" >> $GITHUB_ENV
29+
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
30+
echo "label=3.x" >> $GITHUB_ENV
31+
else
32+
echo "label=" >> $GITHUB_ENV
33+
fi
34+
35+
- name: Add label to Pull Request
36+
if: env.label != ''
37+
uses: actions-ecosystem/action-add-labels@v1
2338
with:
24-
labels: |
25-
minor release
26-
bug
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
labels: ${{ env.label }}
2941
lint:
3042
runs-on: ubuntu-latest
3143
steps:

0 commit comments

Comments
 (0)