From 83e657b1bb54441669687ea7320e3e5aa9330075 Mon Sep 17 00:00:00 2001 From: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com> Date: Fri, 1 May 2026 12:58:21 -0700 Subject: [PATCH 1/3] fix(ci): preserve PR author on backport commits The Direct Backport Push workflow committed the cherry-picked change with github-actions[bot] as both author and committer because git config sets the bot identity before 'git commit -F -' runs and 'git cherry-pick --no-commit' does not retain authorship in the index. Capture the squash-merge commit's author and pass it explicitly via --author=, so the backport commit on the release branch keeps the original PR author and only the committer is the bot. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/direct-backport-push.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/direct-backport-push.yml b/.github/workflows/direct-backport-push.yml index 149a5cbd0ec..8e5f849d973 100644 --- a/.github/workflows/direct-backport-push.yml +++ b/.github/workflows/direct-backport-push.yml @@ -153,6 +153,7 @@ jobs: pr_title=$(gh pr view "${PR_NUMBER}" --json title --jq .title) pr_body=$(gh pr view "${PR_NUMBER}" --json body --jq .body) + original_author=$(git log -1 --format='%an <%ae>' "${MERGE_SHA}") git fetch --no-tags origin "${TARGET_BRANCH}" git checkout -B "${TARGET_BRANCH}" "origin/${TARGET_BRANCH}" @@ -164,6 +165,6 @@ jobs: printf '%s\n\n' "${pr_body}" fi printf '(cherry picked from commit %s)\n' "${MERGE_SHA}" - } | git commit -F - + } | git commit -F - --author="${original_author}" git push origin "HEAD:${TARGET_BRANCH}" From a6e2de5db6731be0d1d99f0927c4f03a73dfa926 Mon Sep 17 00:00:00 2001 From: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com> Date: Fri, 1 May 2026 13:04:03 -0700 Subject: [PATCH 2/3] fix(ci): reuse the squash commit's message to preserve co-authors Building the backport commit message from 'gh pr view --json body' loses the Co-Authored-By trailers that GitHub injects into the squash commit when a PR has commits from multiple contributors. Use the squash commit's full message via 'git log -1 --format=%B' instead so the cherry-picked commit on the release branch keeps both the original author and every co-author. Drop the now-unused gh CLI calls and the GH_TOKEN env in this step. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/direct-backport-push.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/direct-backport-push.yml b/.github/workflows/direct-backport-push.yml index 8e5f849d973..ce5e9a1f0ff 100644 --- a/.github/workflows/direct-backport-push.yml +++ b/.github/workflows/direct-backport-push.yml @@ -137,8 +137,6 @@ jobs: env: MERGE_SHA: ${{ github.sha }} TARGET_BRANCH: ${{ matrix.target }} - PR_NUMBER: ${{ needs.discover.outputs.pr_number }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail @@ -151,20 +149,19 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - pr_title=$(gh pr view "${PR_NUMBER}" --json title --jq .title) - pr_body=$(gh pr view "${PR_NUMBER}" --json body --jq .body) + # Reuse the squash commit's full message so the PR title, description, + # and any Co-Authored-By trailers GitHub injected stay attached to + # the backport commit. The author is the squash commit's author + # (the original PR author for squash merges). original_author=$(git log -1 --format='%an <%ae>' "${MERGE_SHA}") + merge_message=$(git log -1 --format=%B "${MERGE_SHA}") git fetch --no-tags origin "${TARGET_BRANCH}" git checkout -B "${TARGET_BRANCH}" "origin/${TARGET_BRANCH}" git cherry-pick --no-commit "${MERGE_SHA}" { - printf '%s (#%s)\n\n' "${pr_title}" "${PR_NUMBER}" - if [[ -n "${pr_body}" ]]; then - printf '%s\n\n' "${pr_body}" - fi - printf '(cherry picked from commit %s)\n' "${MERGE_SHA}" + printf '%s\n\n(cherry picked from commit %s)\n' "${merge_message}" "${MERGE_SHA}" } | git commit -F - --author="${original_author}" git push origin "HEAD:${TARGET_BRANCH}" From a51bceac2e476b647048dabe310e5deaf4ade72f Mon Sep 17 00:00:00 2001 From: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com> Date: Fri, 1 May 2026 13:05:04 -0700 Subject: [PATCH 3/3] fix(ci): label the trailer as backported instead of cherry picked The Direct Backport Push workflow stamps a trailer on the release branch commit pointing back at the squash commit on main. Use '(backported from commit ...)' instead of '(cherry picked from commit ...)' so the release log reads as the dedicated backport event rather than a generic cherry-pick. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/direct-backport-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/direct-backport-push.yml b/.github/workflows/direct-backport-push.yml index ce5e9a1f0ff..2bee5b53b69 100644 --- a/.github/workflows/direct-backport-push.yml +++ b/.github/workflows/direct-backport-push.yml @@ -161,7 +161,7 @@ jobs: git cherry-pick --no-commit "${MERGE_SHA}" { - printf '%s\n\n(cherry picked from commit %s)\n' "${merge_message}" "${MERGE_SHA}" + printf '%s\n\n(backported from commit %s)\n' "${merge_message}" "${MERGE_SHA}" } | git commit -F - --author="${original_author}" git push origin "HEAD:${TARGET_BRANCH}"