Skip to content

Commit

Permalink
chore: ci optimize (#2692)
Browse files Browse the repository at this point in the history
* chore: ci optimize

* fix: delete useles

* fix: delete useles
  • Loading branch information
Alex-huxiyang authored Nov 1, 2024
1 parent 53571d1 commit d9151f1
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,11 @@ on:
branches:
- next
- V3.0
pull_request:
branches:
- next
- V3.0
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions: write-all

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

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

- 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 Pull Request
if: github.event_name == 'pull_request_target' && env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
lint:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -112,3 +81,29 @@ jobs:

- name: Build NutUI-React Taro H5 Demo
run: npm run build:taro:site

add-label:
runs-on: ubuntu-latest

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

- 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 Pull Request
if: env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}

0 comments on commit d9151f1

Please sign in to comment.