From 1aaaa4599573cdab4ea949283e4ca73476b0ace5 Mon Sep 17 00:00:00 2001 From: jubaoliang Date: Tue, 11 Aug 2026 14:40:03 +0000 Subject: [PATCH] ci: set git identity for Sync Main Into Develop GitHub-hosted runners have no committer name/email, so merge commits failed before conflicts could be handled. Abort only when MERGE_HEAD exists. Co-authored-by: Cursor --- .github/workflows/sync-main-to-develop.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-main-to-develop.yml b/.github/workflows/sync-main-to-develop.yml index ffa63da8..86055936 100644 --- a/.github/workflows/sync-main-to-develop.yml +++ b/.github/workflows/sync-main-to-develop.yml @@ -50,6 +50,8 @@ jobs: TAG: ${{ github.event.release.tag_name || github.event.workflow_run.head_branch || 'manual' }} run: | set -euo pipefail + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" version="${TAG#v}" sync_branch="chore/sync-develop-after-${version}" git fetch origin main develop @@ -77,7 +79,9 @@ jobs: git checkout -B "${sync_branch}" git push -u origin "${sync_branch}" --force else - git merge --abort + if [ -f .git/MERGE_HEAD ]; then + git merge --abort + fi echo "Merge conflict — rebuilding develop on main tip." git diff --name-only origin/main "${saved_develop}" > /tmp/diff_files.txt || true