Skip to content

Commit

Permalink
gh workflows auto-backport, backport-based-on-label
Browse files Browse the repository at this point in the history
Remove backport-based-on-label.
Make auto-backport to use backport-based-on-label multi commit mechanism.
  • Loading branch information
thomas-roos committed Oct 2, 2024
1 parent 168af3a commit cb070a5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 54 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/auto-approve-and-enable-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ on:
types: [review_requested]
branches:
- '*-next'
jobs:

jobs:
auto-approve-and-merge:
runs-on: ubuntu-latest
name: auto approve and enable auto-merge
name: auto approve and enable auto-merge
steps:
- name: Sleep for 5 min (give PR time to create labels)
run: sleep 5m
shell: bash

- name: check label after delay
uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: auto-integrate,version-upgrade
any_of: auto-backport
repo_token: ${{ secrets.BOT2_CREDENTIAL }}

- name: Auto approve
uses: juliangruber/[email protected]
with:
Expand All @@ -33,5 +33,3 @@ jobs:
token: ${{ secrets.BOT2_CREDENTIAL }}
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: rebase


36 changes: 15 additions & 21 deletions .github/workflows/auto-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@ on:
branches:
- master-next
types: ["closed"]

permissions:
contents: write
pull-requests: write
jobs:
cherry_pick:
strategy:
fail-fast: false
matrix:
branch: [kirkstone, scarthgap, styhead]
backport:
name: Backport pull request
runs-on: ubuntu-22.04
name: Cherry pick into release branches
if: |
(github.event.pull_request.merged == true ) &&
(contains(github.event.pull_request.labels.*.name, 'version-upgrade') || contains(github.event.pull_request.labels.*.name, 'auto-backport'))
# Only run when pull request is merged and labeled 'backport'
if: (github.event.pull_request.merged == true ) &&
(contains(github.event.pull_request.labels.*.name, 'version-upgrade') || contains(github.event.pull_request.labels.*.name, 'auto-backport'))
steps:
- name: checkout current
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cherry pick into ${{ matrix.branch }}-next
uses: carloscastrojumo/github-cherry-pick-action@v1.0.6
- name: Create backport pull requests
uses: korthout/backport-action@v3.1.0
with:
branch: ${{ matrix.branch }}-next
labels: |
auto-created
backport
${{ matrix.branch }}
auto-integrate
token: ${{ secrets.BOT_CREDENTIAL }}
target_branches: kirkstone-next scarthgap-next styhead-next
# copy all labels (backport labels are automatically skipped)
copy_labels_pattern: .+
github_token: ${{ secrets.BOT_CREDENTIAL }}
25 changes: 0 additions & 25 deletions .github/workflows/backport-based-on-label.yml

This file was deleted.

0 comments on commit cb070a5

Please sign in to comment.