From 22812b4250b101b395a13676b5650e55689057da Mon Sep 17 00:00:00 2001 From: Ying-Jer Kao Date: Tue, 7 Jul 2026 15:40:30 +0800 Subject: [PATCH] ci: set git committer identity before merging the target branch The "Merge with latest target branch (pull_request only)" step runs `git merge --no-edit origin/` without a configured committer identity. Whenever a PR head is behind its base branch the merge is not a fast-forward no-op, so git needs to create a merge commit and fails with "fatal: empty ident name (for ) not allowed", killing the job with exit code 128 before any real work (observed on PR #984, run 28790515780). PRs branched from the base tip pass only because the merge is "Already up to date". Configure the github-actions[bot] identity before the merge, matching what release_pypi.yml already does. Affects ci-cmake_tests.yml, ci-downstream-find-package.yml, clang-format-check.yml, and conda_build.yml; the step is otherwise unchanged. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci-cmake_tests.yml | 4 ++++ .github/workflows/ci-downstream-find-package.yml | 4 ++++ .github/workflows/clang-format-check.yml | 4 ++++ .github/workflows/conda_build.yml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/.github/workflows/ci-cmake_tests.yml b/.github/workflows/ci-cmake_tests.yml index a968de6a7..b936e514b 100644 --- a/.github/workflows/ci-cmake_tests.yml +++ b/.github/workflows/ci-cmake_tests.yml @@ -30,9 +30,13 @@ jobs: # When re-running a PR job, GitHub Actions uses the merge commit created at # the time of the original run, not a fresh merge with the latest target branch. # This step ensures we always test against the most recent target branch. + # A committer identity is required because a non-fast-forward merge creates + # a merge commit. - name: Merge with latest target branch (pull_request only) if: github.event_name == 'pull_request' run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" git fetch origin ${{ github.event.pull_request.base.ref }} git merge --no-edit origin/${{ github.event.pull_request.base.ref }} # Refresh submodules in case the merge moved any gitlinks (e.g. cmake_modules/morse_cmake). diff --git a/.github/workflows/ci-downstream-find-package.yml b/.github/workflows/ci-downstream-find-package.yml index fda3baa58..07dc8497b 100644 --- a/.github/workflows/ci-downstream-find-package.yml +++ b/.github/workflows/ci-downstream-find-package.yml @@ -61,9 +61,13 @@ jobs: # Match ci-cmake_tests.yml: re-runs of a PR job use the original merge # commit, so merge the latest target branch to test against current tip. + # A committer identity is required because a non-fast-forward merge creates + # a merge commit. - name: Merge with latest target branch (pull_request only) if: github.event_name == 'pull_request' run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" git fetch origin ${{ github.event.pull_request.base.ref }} git merge --no-edit origin/${{ github.event.pull_request.base.ref }} # Refresh submodules in case the merge moved any gitlinks. diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index d37eaaa5f..c933ae2d8 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -14,9 +14,13 @@ jobs: # When re-running a PR job, GitHub Actions uses the merge commit created at # the time of the original run, not a fresh merge with the latest target branch. # This step ensures we always test against the most recent target branch. + # A committer identity is required because a non-fast-forward merge creates + # a merge commit. - name: Merge with latest target branch (pull_request only) if: github.event_name == 'pull_request' run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" git fetch origin ${{ github.event.pull_request.base.ref }} git merge --no-edit origin/${{ github.event.pull_request.base.ref }} diff --git a/.github/workflows/conda_build.yml b/.github/workflows/conda_build.yml index 7762c9b5b..d0d40d017 100644 --- a/.github/workflows/conda_build.yml +++ b/.github/workflows/conda_build.yml @@ -30,9 +30,13 @@ jobs: # When re-running a PR job, GitHub Actions uses the merge commit created at # the time of the original run, not a fresh merge with the latest target branch. # This step ensures we always test against the most recent target branch. + # A committer identity is required because a non-fast-forward merge creates + # a merge commit. - name: Merge with latest target branch (pull_request only) if: github.event_name == 'pull_request' run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" git fetch origin ${{ github.event.pull_request.base.ref }} git merge --no-edit origin/${{ github.event.pull_request.base.ref }} # Refresh submodules in case the merge moved any gitlinks (e.g. cmake_modules/morse_cmake).