Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Merge 2021.1 -> 2021.2 #7

Merge 2021.1 -> 2021.2

Merge 2021.1 -> 2021.2 #7

Workflow file for this run

name: Merge and PR into 2021.2
run-name: Merge 2021.1 -> 2021.2
on:
pull_request_target:
types:
- closed
branches:
- 'mps/2021.1'
jobs:
merge-and-PR-into-2021-2:
# 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 mps/2021.2
uses: actions/checkout@v3
with:
ref: 'mps/2021.2'
fetch-depth: 0
# actually merge from the previous branch
- name: Perform merge from 2021.1 to 2021.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.1 -> 2021.2" origin/mps/2021.1 -- || ( 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// (2020.3 -> 2021.1)}"
echo "NEW_TITLE=$NEW_TITLE" >> $GITHUB_ENV
# create a PR based on the merge
- name: Create PR for MPS 2021.2
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MPS_REPO_PAT }}
branch: 'merge/2021.2'
commit-message: Merge mps/2021.1 into mps/2021.2
title: ${{ env.NEW_TITLE }} (2021.1 -> 2021.2)
body: |
This is an automatic PR which merges changes from `mps/2021.1` to `mps/2021.2`.
[Link to previous PR for `mps/2021.1`](${{ github.event.pull_request._links.html.href }})