Skip to content

Commit 148a8c7

Browse files
Add job to check if PR has merge conflicts with release branches (#2933)
1 parent 56d5cbe commit 148a8c7

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check release branch
2+
inputs:
3+
release-branch:
4+
description: 'Release branch to check'
5+
required: true
6+
default: '3.x'
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Squash current branch commits
11+
id: get-commit-to-cherry-pick
12+
shell: bash
13+
run: |
14+
git checkout -b ${{github.head_ref}}-squashed
15+
git reset --soft refs/remotes/origin/master
16+
git add -A
17+
git config user.email "dummy@commit.com"
18+
git config user.name "Dummy commit"
19+
git commit -m "squashed commit"
20+
echo "commit-to-cherry-pick=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
21+
- name: Attempt merge current branch to ${{ inputs.release-branch }}
22+
shell: bash
23+
run: |
24+
git checkout ${{ inputs.release-branch }}
25+
git cherry-pick ${{ steps.get-commit-to-cherry-pick.outputs.commit-to-cherry-pick}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release branches check
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
check-release-branch-v2:
9+
if: "!contains(github.event.pull_request.labels.*.name, 'dont-land-on-v2.x')"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- uses: ./.github/actions/check-release-branch
16+
with:
17+
release-branch: v2.x
18+
19+
check-release-branch-v3:
20+
if: "!contains(github.event.pull_request.labels.*.name, 'dont-land-on-v3.x')"
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
- uses: ./.github/actions/check-release-branch
27+
with:
28+
release-branch: v3.x

0 commit comments

Comments
 (0)