Skip to content

Commit

Permalink
[ci][backport-pr] Fetch all commits, configure git author
Browse files Browse the repository at this point in the history
gherrit-pr-id: I8c3db36d20b511c31ec774db68896f2fe4b539bb
  • Loading branch information
joshlf committed Nov 5, 2024
1 parent 3d5a8a6 commit d43979d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/backport-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,27 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.target_branch }}
# Check out the entire repository so that the target commit is checked
# out (by default, only fetches the single commit identified by the
# `ref` argument).
fetch-depth: 0
persist-credentials: false
- name: Cherry-pick commit
run: |
set -eo pipefail
AUTHOR_NAME="$(git log -1 --pretty='%an' ${{ github.event.inputs.commit }})"
AUTHOR_EMAIL="$(git log -1 --pretty='%ae' ${{ github.event.inputs.commit }})"
git config --global user.name "$AUTHOR_NAME"
git config --global user.email "$AUTHOR_EMAIL"
git cherry-pick ${{ github.event.inputs.commit }}
PR_TITLE="$(git log -1 --pretty=%s)"
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
AUTHOR="$(git log -1 --pretty='%an <%ae>')"
AUTHOR="$AUTHOR_NAME <$AUTHOR_EMAIL>"
echo "AUTHOR=$AUTHOR" >> $GITHUB_ENV
- name: Submit PR
Expand Down

0 comments on commit d43979d

Please sign in to comment.