-
Notifications
You must be signed in to change notification settings - Fork 26
48 lines (42 loc) · 1.81 KB
/
cherry-pick-pr-to-newer-release-cycle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# GitHub Action: Cherry-pick merged PRs to `TARGET_BRANCH`
#
# This action automates the process of cherry-picking merged PRs from `release/candidate` branch to `TARGET_BRANCH`.
# It is triggered whenever a pull request is merged into `release/candidate`.
#
# The action performs the following steps:
# 1. Checkout the merged PR.
# 2. If changes are made outside the specified submodule or no submodule is specified, the action proceeds.
# 3. If a submodule name is provided in the `SUBMODULE_NAME` environment variable:
# a. The action creates a temporary branch.
# b. Updates the submodule to its latest version from the target branch.
# c. Commits the submodule updates.
# 4. Squashes the commit with the commit message of the merged PR (if a submodule was updated).
# 5. Cherry-picks the squashed (or original if no squashing occurred) commit to a new branch based on target.
# 6. If any conflicts arise during the cherry-pick, they are committed.
# 7. The branch with the cherry-picked changes is pushed.
# 8. A new pull request is created against `develop` with the cherry-picked changes.
name: "Cherry-pick from 4.6 to RC"
on:
pull_request:
branches:
- release/cycle-4.6
types:
- closed
jobs:
cherry-pick:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cherry pick to `RC`
uses: wireapp/[email protected]
with:
target-branch: release/candidate
submodule-name: kalium
pr-title-suffix: 🍒
labels: cherry-pick