From bd4b46c8f74d53896b2f1143db7293c83f3df701 Mon Sep 17 00:00:00 2001 From: oasis-cloud Date: Tue, 19 Nov 2024 18:52:47 +0800 Subject: [PATCH] chore: update ci --- .github/workflows/add-label.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 28 +--------------------------- 2 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/add-label.yml diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml new file mode 100644 index 0000000000..0f7f6e7942 --- /dev/null +++ b/.github/workflows/add-label.yml @@ -0,0 +1,33 @@ +name: Add Label + +on: + pull_request_target: + types: [opened, synchronize, reopened] + workflow_dispatch: + +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: env.label != '' + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: ${{ env.label }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99073ad7c0..b3da80e14c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,30 +82,4 @@ jobs: run: npm run build:site - 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 }} \ No newline at end of file + run: npm run build:taro:site \ No newline at end of file