You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2023/08/07 04:25:25 UTC
[incubator-devlake] branch release-v0.18-auto-cherry-pick created (now 42224d902)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch release-v0.18-auto-cherry-pick
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 42224d902 refactor: update to main
This branch includes the following new commits:
new 42224d902 refactor: update to main
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-devlake] 01/01: refactor: update to main
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch release-v0.18-auto-cherry-pick
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 42224d902b3dea450bf6c0f86a9cd5a4389b8158
Author: mintsweet <0x...@gmail.com>
AuthorDate: Mon Aug 7 16:25:13 2023 +1200
refactor: update to main
---
.github/actions/auto-cherry-pick/action.yml | 4 ++--
.github/actions/auto-cherry-pick/cherry-pick.sh | 25 +++++++++++--------------
.github/workflows/auto-cherry-pick.yml | 1 -
3 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/.github/actions/auto-cherry-pick/action.yml b/.github/actions/auto-cherry-pick/action.yml
index 4d0966825..9874ae1fd 100644
--- a/.github/actions/auto-cherry-pick/action.yml
+++ b/.github/actions/auto-cherry-pick/action.yml
@@ -15,7 +15,7 @@
# limitations under the License.
#
-name: "Auto Cherrry Pick"
+name: "Auto Cherry Pick"
description: "cherry pick commits from Pull Requests into Release branch"
inputs:
author_email:
@@ -28,6 +28,7 @@ inputs:
required: false
assignees:
description: "A comma or newline separated list of assignees (GitHub usernames)."
+ default: ${{ github.actor }}
required: false
runs:
using: "composite"
@@ -40,7 +41,6 @@ runs:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
- PR_BODY: ${{ github.event.pull_request.body }}
LABEL_NAME: ${{ github.event.label.name }}
AUTHOR_EMAIL: ${{ inputs.author_email }}
AUTHOR_NAME: ${{ inputs.author_name }}
diff --git a/.github/actions/auto-cherry-pick/cherry-pick.sh b/.github/actions/auto-cherry-pick/cherry-pick.sh
index 97c697d57..484bd7e37 100644
--- a/.github/actions/auto-cherry-pick/cherry-pick.sh
+++ b/.github/actions/auto-cherry-pick/cherry-pick.sh
@@ -20,16 +20,15 @@
set -e
TARGET_BRANCH="release-${LABEL_NAME##*-}"
-PR_BRANCH="auto-cherry-pick-$TARGET_BRANCH-$GITHUB_SHA"
+PR_BRANCH="$TARGET_BRANCH-auto-cherry-pick-$PR_NUMBER"
AUTO_CHERRY_PICK_LABEL="bot/auto-cherry-pick"
AUTO_CHERRY_PICK_VERSION_LABEL="bot/auto-cherry-pick-for-$TARGET_BRANCH"
AUTO_CHERRY_PICK_FAILED_LABEL="bot/auto-cherry-pick-failed"
AUTO_CHERRY_PICK_COMPLETED_LABEL="bot/auto-cherry-pick-completed"
-echo "==================== Basic Info ===================="
+echo "::group::Basic Info"
echo "PR Number: $PR_NUMBER"
echo "PR Title: $PR_TITLE"
-echo "PR Body: $PR_BODY"
echo "Label: $LABEL_NAME"
echo "GitHub SHA: $GITHUB_SHA"
echo "Author Email: $AUTHOR_EMAIL"
@@ -37,31 +36,29 @@ echo "Author Name: $AUTHOR_NAME"
echo "Assignees: $ASSIGNEES"
echo "Target Branch: $TARGET_BRANCH"
echo "PR Branch: $PR_BRANCH"
+echo "::endgroup::"
-echo "==================== Git Cherry Pick ===================="
+echo "::group::Git Cherry Pick"
git config --global user.email "$AUTHOR_EMAIL"
git config --global user.name "$AUTHOR_NAME"
git remote update
git fetch --all
-git restore .
git checkout -b $PR_BRANCH origin/$TARGET_BRANCH
-git cherry-pick -m 1 --strategy=recursive --strategy-option=theirs $GITHUB_SHA || (
+git cherry-pick $GITHUB_SHA || (
gh pr comment $PR_NUMBER --body "🤖 The current file has a conflict, and the pr cannot be automatically created."
- gh pr edit $PR_NUMBER --add-label $AUTO_CHERRY_PICK_FAILED_LABEL || (
- gh label create $AUTO_CHERRY_PICK_FAILED_LABEL -c "#D93F0B" -d "auto cherry pick failed"
- gh pr edit $PR_NUMBEr --add-label $AUTO_CHERRY_PICK_FAILED_LABEL
- )
+ gh pr edit $PR_NUMBEr --add-label $AUTO_CHERRY_PICK_FAILED_LABEL
exit 1
)
git push origin $PR_BRANCH
+echo "::endgroup::"
-echo "==================== GitHub Auto Create PR ===================="
+echo "::group::GitHub Auto Create PR"
AUTO_CREATED_PR_LINK=$(gh pr create \
-B $TARGET_BRANCH \
-H $PR_BRANCH \
- -t "$PR_TITLE (cherry-picked-from #$PR_NUMBER)" \
- -b "$PR_BODY" \
+ -t "cherry-pick #$PR_NUMBER $PR_TITLE" \
+ -b "cherry-pick #$PR_NUMBER $PR_TITLE" \
-a $ASSIGNEES)
gh pr comment $PR_NUMBER --body "🤖 cherry pick finished successfully 🎉!"
@@ -72,7 +69,7 @@ gh pr edit $PR_NUMBER --add-label $AUTO_CHERRY_PICK_COMPLETED_LABEL || (
gh pr comment $AUTO_CREATED_PR_LINK --body "🤖 this a auto create pr!cherry picked from #$PR_NUMBER."
gh pr edit $AUTO_CREATED_PR_LINK --add-label "$AUTO_CHERRY_PICK_LABEL,$AUTO_CHERRY_PICK_VERSION_LABEL" || (
- gh label create $AUTO_CHERRY_PICK_LABEL -c "#5319E7" -d "auto cherry pick pr"
gh label create $AUTO_CHERRY_PICK_VERSION_LABEL -c "#5319E7" -d "auto cherry pick pr for $TARGET_BRANCH"
gh pr edit $AUTO_CREATED_PR_LINK --add-label "$AUTO_CHERRY_PICK_LABEL,$AUTO_CHERRY_PICK_VERSION_LABEL"
)
+echo "::endgroup::"
diff --git a/.github/workflows/auto-cherry-pick.yml b/.github/workflows/auto-cherry-pick.yml
index 9d3cefa23..f34904b16 100644
--- a/.github/workflows/auto-cherry-pick.yml
+++ b/.github/workflows/auto-cherry-pick.yml
@@ -37,4 +37,3 @@ jobs:
with:
author_email: action_bot@users.noreply.devlake.com
author_name: action_bot
- assignees: abeizn