Commit db24a7b 1 parent 3d5a8a6 commit db24a7b Copy full SHA for db24a7b
File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -29,22 +29,33 @@ jobs:
29
29
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30
30
with :
31
31
ref : ${{ github.event.inputs.target_branch }}
32
+ # Check out the entire repository so that the target commit is checked
33
+ # out (by default, only fetches the single commit identified by the
34
+ # `ref` argument).
35
+ fetch-depth : 0
32
36
persist-credentials : false
33
37
- name : Cherry-pick commit
34
38
run : |
35
39
set -eo pipefail
40
+
41
+ AUTHOR_NAME="$(git log -1 --pretty='%an' ${{ github.event.inputs.commit }})"
42
+ AUTHOR_EMAIL="$(git log -1 --pretty='%ae' ${{ github.event.inputs.commit }})"
43
+
44
+ git config --global user.name "$AUTHOR_NAME"
45
+ git config --global user.email "$AUTHOR_EMAIL"
46
+
36
47
git cherry-pick ${{ github.event.inputs.commit }}
37
-
48
+
38
49
PR_TITLE="$(git log -1 --pretty=%s)"
39
50
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
40
51
41
- AUTHOR="$(git log -1 --pretty='%an <% ae>') "
52
+ AUTHOR="$AUTHOR_NAME <$AUTHOR_EMAIL> "
42
53
echo "AUTHOR=$AUTHOR" >> $GITHUB_ENV
43
54
44
55
- name : Submit PR
45
56
uses : peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
46
57
with :
47
- author: "${{ env.AUTHOR }}"
58
+ author : Google PR Creation Bot <github-pull-request-creation-bot@google.com>
48
59
committer : " ${{ env.AUTHOR }}"
49
60
title : " ${{ env.PR_TITLE }}"
50
61
branch : backport-${{ github.event.inputs.commit }}
You can’t perform that action at this time.
0 commit comments