The GitHub Actions job "Build" on texera.git/main has succeeded.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
d3575ae98566f3167f95d01c4a94906e004bebfa / Yicong Huang 
<[email protected]>
fix(ci): preserve PR author on backport commits (#4614)

### What changes were proposed in this PR?

The `Direct Backport Push` workflow added in #4598 commits the
cherry-pick onto the release branch with `github-actions[bot]` as both
author and committer, and rebuilds the commit message from the PR title
and description fetched via `gh pr view`. Two issues:

- The committer takeover happens because `git config user.name/email`
runs before `git commit -F -` and `git cherry-pick --no-commit` does not
retain the original commit's authorship in the index.
- Reconstructing the message from `gh pr view --json body` drops the
`Co-Authored-By` trailers that GitHub injects into the squash commit
when a PR has commits from multiple contributors, so co-authors are lost
on the release branch.

This PR captures the squash commit's author with `git log -1
--format='%an <%ae>'` and passes it to `git commit --author=`, and
reuses the squash commit's full message via `git log -1 --format=%B`
instead of reconstructing it. A `(backported from commit <sha>)` trailer
is appended at the end.

After this fix the backport commit on the release branch carries the
original PR author, all `Co-Authored-By` trailers from the squash
commit, and `github-actions[bot]` only as the committer (preserving the
audit trail for the automated push).

### Any related issues, documentation, discussions?

Follow-up to #4598.

### How was this PR tested?

Local verification of the commit construction: cherry-picking the squash
commit with `--no-commit` and committing with `--author=<original>`
produces a commit whose `Author` line matches the squash author, whose
`Committer` line is `github-actions[bot]`, and whose body contains the
squash commit's full body (including any `Co-Authored-By` trailers) plus
a `(backported from commit ...)` footer.

The next `Direct Backport Push` invocation against a `release/*`
labelled PR will surface the new author and trailers on the
cherry-picked commit on the release branch; existing backport commits
already on release branches are unaffected.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

Report URL: https://github.com/apache/texera/actions/runs/25231937211

With regards,
GitHub Actions via GitBox

Reply via email to