Skip to content

Commit

Permalink
[Tool] Add PR Template for branch-3.1 (#24984)
Browse files Browse the repository at this point in the history
Add PR Template for branch-3.1 
Signed-off-by: AndyZiYe <[email protected]>
  • Loading branch information
andyziye authored Jun 9, 2023
1 parent acadd8c commit e17f8e3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 15 additions & 15 deletions .github/workflows/ci-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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')
Expand All @@ -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]') ||
Expand Down

0 comments on commit e17f8e3

Please sign in to comment.