Sync PocketMine-MP primary branches #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync PocketMine-MP primary branches | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to update' | |
required: true | |
type: choice | |
options: | |
- minor-next | |
- major-next | |
- "*" | |
jobs: | |
merge: | |
name: Sync branches | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/PocketMine-MP # to allow testing on forks without editing the workflow | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.POCKETMINE_MP_DEPLOY_KEY }} | |
- name: Set Git config | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Merge "stable" into "minor-next" | |
if: contains(fromJSON('["minor-next", "*"]'), github.event.inputs.branch) | |
run: | | |
git checkout -f minor-next | |
git pull --ff origin stable | |
- name: Merge "minor-next" into "major-next" | |
if: contains(fromJSON('["major-next", "*"]'), github.event.inputs.branch) | |
run: | | |
git checkout -f major-next | |
git pull --ff origin minor-next | |
- name: Push changes | |
run: git push origin minor-next major-next |