Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub workflow to merge this branch into 2022.2 #674

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/PR-into-2022-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Merge and PR into 2022.2

run-name: Merge 2021.3 -> 2022.2
on:
pull_request_target:
types:
- closed
branches:
- 'maintenance/mps20213'

jobs:
merge-and-pr:
# only trigger if it was actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:
# checkout the target branch
- name: Checkout 2022.2
uses: actions/checkout@v3
with:
ref: 'maintenance/mps20222'
fetch-depth: 0

# actually merge from the previous branch
- name: Perform merge from 2021.3 to 2022.2
run: |
# setup to allow to merge and commit
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

# actual merge operation
git merge --no-ff --message "Merge 2021.3 -> 2022.2" origin/maintenance/mps20213 -- || ( echo "Merge failed. Please merge manually!" ; exit 1 )

# actually merge from the previous branch
- name: Prepare environment variables for PR
run: |
# strip the title of previous automatic PR content
NEW_TITLE='${{ github.event.pull_request.title }}'
NEW_TITLE="${NEW_TITLE// (2021.2 -> 2021.3)}"
sergej-koscejev marked this conversation as resolved.
Show resolved Hide resolved
echo "NEW_TITLE=$NEW_TITLE" >> $GITHUB_ENV

# create a PR based on the merge
- name: Create PR for MPS 2022.2
uses: peter-evans/create-pull-request@v5
with:
branch: 'merge/2022.2'
commit-message: Merge mps/2022.3 into mps/2022.2
sergej-koscejev marked this conversation as resolved.
Show resolved Hide resolved
title: ${{ env.NEW_TITLE }} (2021.3 -> 2022.2)
body: |
This is an automatic PR which merges changes from `maintenance/mps20213` to `maintenance/mps20222`

[Link to previous PR for `maintenance/mps20213`](${{ github.event.pull_request._links.html.href }})