From e17f8e37c17d935872da3999822d8a0db9e59bee Mon Sep 17 00:00:00 2001 From: andyziye <108652123+andyziye@users.noreply.github.com> Date: Fri, 9 Jun 2023 16:31:58 +0800 Subject: [PATCH] [Tool] Add PR Template for branch-3.1 (#24984) Add PR Template for branch-3.1 Signed-off-by: AndyZiYe --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci-merged.yml | 30 +++++++++++++++--------------- .github/workflows/pr-checker.yml | 22 +++++++++++----------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9d5847f218f34..ff3b7f8e01e61 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,7 @@ Fixes #issue ## Bugfix cherry-pick branch check: - [ ] I have checked the version labels which the pr will be auto-backported to the target branch + - [ ] 3.1 - [ ] 3.0 - [ ] 2.5 - [ ] 2.4 - - [ ] 2.3 diff --git a/.github/workflows/ci-merged.yml b/.github/workflows/ci-merged.yml index e2194386dc3c8..54ab6967e1810 100644 --- a/.github/workflows/ci-merged.yml +++ b/.github/workflows/ci-merged.yml @@ -15,13 +15,26 @@ jobs: github.base_ref == 'main' && !contains(github.event.pull_request.title, 'cherry-pick') && !contains(github.event.pull_request.title, 'backport') && ( + contains(github.event.pull_request.labels.*.name, '3.1') || contains(github.event.pull_request.labels.*.name, '3.0') || contains(github.event.pull_request.labels.*.name, '2.5') || - contains(github.event.pull_request.labels.*.name, '2.4') || - contains(github.event.pull_request.labels.*.name, '2.3') ) + contains(github.event.pull_request.labels.*.name, '2.4') ) env: PR_NUMBER: ${{ github.event.number }} steps: + - name: backport branch-3.1 + if: contains(github.event.pull_request.labels.*.name, '3.1') + uses: thollander/actions-comment-pull-request@v1 + with: + message: | + @Mergifyio backport branch-3.1 + GITHUB_TOKEN: ${{ secrets.PAT }} + + - uses: actions-ecosystem/action-remove-labels@v1 + if: contains(github.event.pull_request.labels.*.name, '3.1') + with: + labels: '3.1' + - name: backport branch-3.0 if: contains(github.event.pull_request.labels.*.name, '3.0') uses: thollander/actions-comment-pull-request@v1 @@ -61,19 +74,6 @@ jobs: with: labels: '2.4' - - name: backport branch-2.3 - if: contains(github.event.pull_request.labels.*.name, '2.3') - uses: thollander/actions-comment-pull-request@v1 - with: - message: | - @Mergifyio backport branch-2.3 - GITHUB_TOKEN: ${{ secrets.PAT }} - - - uses: actions-ecosystem/action-remove-labels@v1 - if: contains(github.event.pull_request.labels.*.name, '2.3') - with: - labels: '2.3' - thirdparty-update-image: runs-on: self-hosted name: Thirdparty Update Image diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index 0e4a6a7844e2a..26116325a425a 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -4,10 +4,10 @@ on: pull_request_target: branches: - main - - branch-2.3 - branch-2.4 - branch-2.5 - branch-3.0 + - branch-3.1 types: - opened - reopened @@ -33,6 +33,12 @@ jobs: !contains(github.event.pull_request.title, 'backport') steps: + - name: add branch-3.1 label + if: contains(toJson(github.event.pull_request.body), '[x] 3.1') + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: '3.1' + - name: add branch-3.0 label if: contains(toJson(github.event.pull_request.body), '[x] 3.0') uses: actions-ecosystem/action-add-labels@v1 @@ -51,11 +57,11 @@ jobs: with: labels: '2.4' - - name: add branch-2.3 label - if: contains(toJson(github.event.pull_request.body), '[x] 2.3') - uses: actions-ecosystem/action-add-labels@v1 + - name: remove branch-3.1 label + if: contains(toJson(github.event.pull_request.body), '[ ] 3.1') && contains(github.event.pull_request.labels.*.name, '3.1') + uses: actions-ecosystem/action-remove-labels@v1 with: - labels: '2.3' + labels: '3.1' - name: remove branch-3.0 label if: contains(toJson(github.event.pull_request.body), '[ ] 3.0') && contains(github.event.pull_request.labels.*.name, '3.0') @@ -75,12 +81,6 @@ jobs: with: labels: '2.4' - - name: remove branch-2.3 label - if: contains(toJson(github.event.pull_request.body), '[ ] 2.3') && contains(github.event.pull_request.labels.*.name, '2.3') - uses: actions-ecosystem/action-remove-labels@v1 - with: - labels: '2.3' - - name: check-done if: > (startsWith(github.event.pull_request.title, '[BugFix]') ||