Skip to content

Sync primary branches #3

Sync primary branches

Sync primary branches #3

Workflow file for this run

name: Sync primary branches
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to update'
required: true
type: choice
options:
- minor-next
- major-next
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set Git config
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Merge lower branch into target branch
id: merge
run: |
LOWER_BRANCH=""
if [ ${{ github.event.inputs.branch }} == "minor-next" ]; then
LOWER_BRANCH="stable"
else if [ ${{ github.event.inputs.branch }} == "major-next" ]; then
LOWER_BRANCH="minor-next"
else
echo "::error::Invalid branch"
exit 1
fi
git pull origin "$LOWER_BRANCH" || echo "::error::Merge conflict or error detected" && exit 1
- name: Push changes
run: git push origin ${{ github.event.inputs.branch }}