Skip to content

Commit c65e530

Browse files
committed
add template indication to back port; create action based on label to backport changes
1 parent 7b0a9c8 commit c65e530

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

.github/pull_request_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,45 @@ Jira Issue: <https://issues.redhat.com/browse/AAP-NNNN>
1111
1. Pull down the PR
1212
2. ...
1313
3. ...
14+
## Type of Change
15+
- [ ] Bug fix (non-breaking change fixing an issue)
16+
- [ ] New feature (non-breaking change adding functionality)
17+
- [ ] Breaking change (fix or feature causing existing functionality to break)
18+
- [ ] Security fix
19+
- [ ] Performance improvement
20+
- [ ] Code refactoring
21+
- [ ] Documentation update
22+
- [ ] CI/CD update
23+
24+
## Backport Policy
25+
26+
This change should be:
27+
- [ ] **Not backported** - main/master only
28+
- [ ] **Backported** to specific releases (add labels after merge)
29+
30+
### Automated Backport Instructions
31+
32+
**After this PR is merged**, add one or more labels to automatically create backport PRs:
33+
34+
- `backport/stable-2.4` - Backport to stable-2.4 branch
35+
- `backport/stable-2.5` - Backport to stable-2.5 branch
36+
- `backport/stable-2.6` - Backport to stable-2.6 branch
37+
- `backport/all` - Backport to all active stable branches
38+
- `no-backport` - Explicitly mark as not needing backport
39+
40+
### Backport Justification
41+
<!-- Required if backporting. Explain why this needs to be in older releases -->
42+
<!-- Examples: -->
43+
<!-- - Critical bug affecting production -->
44+
<!-- - Security vulnerability fix (include CVE if applicable) -->
45+
<!-- - Regression introduced in X.Y.Z -->
46+
<!-- - Customer-blocking issue -->
47+
<!-- - Data corruption/loss prevention -->
48+
49+
**Special backport considerations:**
50+
<!-- Any conflicts, dependencies, or modifications needed for backport -->
51+
<!-- Will this apply cleanly to older releases? -->
52+
<!-- Does this depend on other commits that also need backporting? -->
1453

1554
### Scenarios tested
1655
<!-- Describe the scenarios you've already manually verified, if applicable. -->

.github/workflows/backport.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Backport merged pull request
2+
3+
on:
4+
pull_request_target:
5+
types: [closed, labeled]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
backport:
13+
name: Backport PR
14+
runs-on: ubuntu-latest
15+
16+
if: github.event.pull_request.merged == true
17+
steps:
18+
19+
- name: Backport to release branches
20+
uses: korthout/backport-action@v3
21+
with:
22+
label_pattern: '^backport/(?<target>.+)$'
23+
24+
target_branches: |
25+
all:stable-2.4 stable-2.5 stable-2.6
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
copy_labels_pattern: '^(bug|security|breaking-change|dependencies)$'
29+
30+
pull_description: |
31+
# Backport of #${pull_number}
32+
${pull_description}
33+
---
34+
**Original PR:** #${pull_number}
35+
**Backported by:** @${{ github.actor }}
36+
## Backport Verification
37+
- [ ] Changes apply cleanly
38+
- [ ] Tests pass
39+
- [ ] No conflicts with target branch
40+
pull_title: "[Backport ${target_branch}] ${pull_title}"

0 commit comments

Comments
 (0)