From 53571d172f73d70d0e19a3b0ead1315d0694f6ac Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Fri, 1 Nov 2024 20:10:21 +0800 Subject: [PATCH] chore: ci (#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 --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1fb91f829..8e221f191f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}