Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Update version to 3.1-BETA and change language level to JDK 17 in Pro… #16

Update version to 3.1-BETA and change language level to JDK 17 in Pro…

Update version to 3.1-BETA and change language level to JDK 17 in Pro… #16

name: Sync master → dev
on:
push:
branches:
- master
permissions:
contents: write # ensure GITHUB_TOKEN can push code
pull-requests: write # allow creating PRs
jobs:
sync-to-dev:
runs-on: ubuntu-latest
steps:
# 1. Checkout all history and branches
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
# 2. Configure Git user
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# 3. Fetch and checkout dev properly, then merge master
- name: Merge master into dev
id: merge
run: |
# If remote dev exists…
if git ls-remote --exit-code --heads origin dev; then
# Fetch just the dev branch
git fetch origin dev
# If we have a local dev, reset it to remote; otherwise create it tracking origin/dev
if git show-ref --quiet refs/heads/dev; then
git checkout dev
git reset --hard origin/dev
else
git checkout -b dev origin/dev
fi
else
# No remote dev yet, branch off master
git checkout -b dev
fi
# Merge the latest master in
git merge origin/master --no-edit
continue-on-error: true
# 4. Push if merge succeeded
- name: Push changes if merge succeeded
if: steps.merge.outcome == 'success'
run: git push origin dev
# 5. Open a PR and request review if there were conflicts
- name: Open Pull Request on conflicts
if: steps.merge.outcome == 'failure'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PAT_PR }}
script: |
// 1) Create the PR from master → dev
const pr = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: 'master',
base: 'dev',
title: '🔀 Merge master → dev (conflicts)',
body: 'Automatic merge from **master** into **dev** failed due to conflicts. Please resolve and merge.',
draft: false
});