Skip to content

Commit cb070a5

Browse files
committed
gh workflows auto-backport, backport-based-on-label
Remove backport-based-on-label. Make auto-backport to use backport-based-on-label multi commit mechanism.
1 parent 168af3a commit cb070a5

File tree

3 files changed

+21
-54
lines changed

3 files changed

+21
-54
lines changed

.github/workflows/auto-approve-and-enable-auto-merge.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ on:
55
types: [review_requested]
66
branches:
77
- '*-next'
8-
9-
jobs:
8+
9+
jobs:
1010
auto-approve-and-merge:
1111
runs-on: ubuntu-latest
12-
name: auto approve and enable auto-merge
12+
name: auto approve and enable auto-merge
1313
steps:
1414
- name: Sleep for 5 min (give PR time to create labels)
1515
run: sleep 5m
1616
shell: bash
17-
17+
1818
- name: check label after delay
1919
uses: docker://agilepathway/pull-request-label-checker:latest
2020
with:
21-
any_of: auto-integrate,version-upgrade
21+
any_of: auto-backport
2222
repo_token: ${{ secrets.BOT2_CREDENTIAL }}
23-
23+
2424
- name: Auto approve
2525
uses: juliangruber/[email protected]
2626
with:
@@ -33,5 +33,3 @@ jobs:
3333
token: ${{ secrets.BOT2_CREDENTIAL }}
3434
pull-request-number: ${{ github.event.pull_request.number }}
3535
merge-method: rebase
36-
37-

.github/workflows/auto-backport.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,24 @@ on:
55
branches:
66
- master-next
77
types: ["closed"]
8-
8+
permissions:
9+
contents: write
10+
pull-requests: write
911
jobs:
10-
cherry_pick:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
branch: [kirkstone, scarthgap, styhead]
12+
backport:
13+
name: Backport pull request
1514
runs-on: ubuntu-22.04
16-
name: Cherry pick into release branches
17-
if: |
18-
(github.event.pull_request.merged == true ) &&
19-
(contains(github.event.pull_request.labels.*.name, 'version-upgrade') || contains(github.event.pull_request.labels.*.name, 'auto-backport'))
15+
# Only run when pull request is merged and labeled 'backport'
16+
if: (github.event.pull_request.merged == true ) &&
17+
(contains(github.event.pull_request.labels.*.name, 'version-upgrade') || contains(github.event.pull_request.labels.*.name, 'auto-backport'))
2018
steps:
21-
- name: checkout current
22-
uses: actions/checkout@v3
19+
- uses: actions/checkout@v3
2320
with:
2421
fetch-depth: 0
25-
- name: Cherry pick into ${{ matrix.branch }}-next
26-
uses: carloscastrojumo/github-cherry-pick-action@v1.0.6
22+
- name: Create backport pull requests
23+
uses: korthout/backport-action@v3.1.0
2724
with:
28-
branch: ${{ matrix.branch }}-next
29-
labels: |
30-
auto-created
31-
backport
32-
${{ matrix.branch }}
33-
auto-integrate
34-
token: ${{ secrets.BOT_CREDENTIAL }}
25+
target_branches: kirkstone-next scarthgap-next styhead-next
26+
# copy all labels (backport labels are automatically skipped)
27+
copy_labels_pattern: .+
28+
github_token: ${{ secrets.BOT_CREDENTIAL }}

.github/workflows/backport-based-on-label.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)