Skip to content

Commit fc4ceac

Browse files
committed
ci(backport): add backport action & releases (nelmio#2594)
## Description Implements https://github.com/korthout/backport-action to create a backport ## What type of PR is this? (check all applicable) - [ ] Bug Fix - [ ] Feature - [ ] Refactor - [ ] Deprecation - [ ] Breaking Change - [ ] Documentation Update - [x] CI ## Checklist - [ ] I have made corresponding changes to the documentation (`docs/`) - [ ] I have made corresponding changes to the changelog (`CHANGELOG.md`)
1 parent 96d2f63 commit fc4ceac

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

.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:
6+
- closed
7+
- labeled
8+
9+
permissions:
10+
contents: write # so it can comment
11+
pull-requests: write # so it can create pull requests
12+
13+
jobs:
14+
backport:
15+
name: Backport pull request
16+
runs-on: ubuntu-latest
17+
if: >
18+
(
19+
github.event.action == 'closed' &&
20+
github.event.pull_request.merged
21+
) ||
22+
(
23+
github.event.action == 'labeled'
24+
&& startsWith(github.event.label.name, 'backport')
25+
&& github.event.pull_request.merged
26+
)
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Create backport pull requests
30+
uses: korthout/backport-action@v3
31+
with:
32+
branch_name: backport-#${pull_number}-to-${target_branch}
33+
pull_description: |
34+
### This is an automated backport of #${pull_number} to branch `${target_branch}`.
35+
36+
> [!CAUTION]
37+
> **Do not modify this pull request.**
38+
39+
${pull_description}
40+
pull_title: "${pull_title} [Backport #${pull_number} to ${target_branch}]"

.github/workflows/release.backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
# for more options
2323
release-type: php
2424
versioning-strategy: always-bump-patch
25-
release-as: 4.0.0
25+
target-branch: 4.x

0 commit comments

Comments
 (0)