From c65e53023ed9da1eea8fa39813ef96e97bc571ca Mon Sep 17 00:00:00 2001 From: acosferreia Date: Mon, 24 Nov 2025 15:38:45 -0500 Subject: [PATCH] add template indication to back port; create action based on label to backport changes --- .github/pull_request_template.md | 39 +++++++++++++++++++++++++++++++ .github/workflows/backport.yml | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 45ecdab..5eefcb0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,6 +11,45 @@ Jira Issue: 1. Pull down the PR 2. ... 3. ... +## Type of Change +- [ ] Bug fix (non-breaking change fixing an issue) +- [ ] New feature (non-breaking change adding functionality) +- [ ] Breaking change (fix or feature causing existing functionality to break) +- [ ] Security fix +- [ ] Performance improvement +- [ ] Code refactoring +- [ ] Documentation update +- [ ] CI/CD update + +## Backport Policy + +This change should be: +- [ ] **Not backported** - main/master only +- [ ] **Backported** to specific releases (add labels after merge) + +### Automated Backport Instructions + +**After this PR is merged**, add one or more labels to automatically create backport PRs: + +- `backport/stable-2.4` - Backport to stable-2.4 branch +- `backport/stable-2.5` - Backport to stable-2.5 branch +- `backport/stable-2.6` - Backport to stable-2.6 branch +- `backport/all` - Backport to all active stable branches +- `no-backport` - Explicitly mark as not needing backport + +### Backport Justification + + + + + + + + +**Special backport considerations:** + + + ### Scenarios tested diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 0000000..902ffe2 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,40 @@ +name: Backport merged pull request + +on: + pull_request_target: + types: [closed, labeled] + +permissions: + contents: write + pull-requests: write + +jobs: + backport: + name: Backport PR + runs-on: ubuntu-latest + + if: github.event.pull_request.merged == true + steps: + + - name: Backport to release branches + uses: korthout/backport-action@v3 + with: + label_pattern: '^backport/(?.+)$' + + target_branches: | + all:stable-2.4 stable-2.5 stable-2.6 + github_token: ${{ secrets.GITHUB_TOKEN }} + + copy_labels_pattern: '^(bug|security|breaking-change|dependencies)$' + + pull_description: | + # Backport of #${pull_number} + ${pull_description} + --- + **Original PR:** #${pull_number} + **Backported by:** @${{ github.actor }} + ## Backport Verification + - [ ] Changes apply cleanly + - [ ] Tests pass + - [ ] No conflicts with target branch + pull_title: "[Backport ${target_branch}] ${pull_title}" \ No newline at end of file