Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#9889][followup]: Fix the cherry-pick logic (#9910)

roryqi40007c804c21
diff --git a/.github/workflows/auto-cherry-pick.yml b/.github/workflows/auto-cherry-pick.yml
index b3f8786985..e9c4005622 100644
--- a/.github/workflows/auto-cherry-pick.yml
+++ b/.github/workflows/auto-cherry-pick.yml
@@ -29,8 +29,12 @@ jobs:
COMMIT_SUBJECT=$(git log -1 --pretty=%s ${{ github.sha }})
echo "Commit: $COMMIT_SUBJECT"
- # Try to extract PR number for later use
- PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -oE '#[0-9]+' | head -1 | sed 's/#//')
+ PR_NUMBER=$(echo "$COMMIT_SUBJECT" | grep -oE '\(#[0-9]+\)' | tail -1 | grep -oE '[0-9]+')
+
+ # If not found, try to match any #xxx pattern
+ if [ -z "$PR_NUMBER" ]; then
+ PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -oE '#[0-9]+' | tail -1 | sed 's/#//')
+ fi
if [ -z "$PR_NUMBER" ]; then
echo "No PR number found, will skip label check"