Skip to content

Commit

Permalink
chore: ci (jdf2e#2690)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Alex-huxiyang authored Nov 1, 2024
1 parent 5a3e7c3 commit 53571d1
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@ on:
push:
branches:
- next

- V3.0
pull_request:
branches:
- next

- V3.0
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions: write-all

jobs:
label:
add-label:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
- name: Check out repository
uses: actions/checkout@v4

- name: Determine label
id: determine_label
- name: Determine label based on target branch
id: determine-label
run: |
echo "${{github.event_name}}"
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
else
echo "label=" >> $GITHUB_ENV
fi
- name: Add label to PR
- name: Add label to Pull Request
if: github.event_name == 'pull_request_target' && env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 53571d1

Please sign in to comment.