This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e89fc4f5f5e MINOR: the label action can't parse content having time 
format specifications (#17384)
e89fc4f5f5e is described below

commit e89fc4f5f5e4a1e607d9789e76378eaa237e7a20
Author: TaiJuWu <[email protected]>
AuthorDate: Mon Oct 7 10:47:30 2024 +0800

    MINOR: the label action can't parse content having time format 
specifications (#17384)
    
    Reviewers: David Arthur <[email protected]>, Chia-Ping Tsai 
<[email protected]>
---
 .github/scripts/label_small.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/scripts/label_small.sh b/.github/scripts/label_small.sh
index 83466c0e705..aff96718b26 100755
--- a/.github/scripts/label_small.sh
+++ b/.github/scripts/label_small.sh
@@ -17,12 +17,12 @@
 LABEL_NAME=small
 MAX_SIZE=100
 
-pr_diff=$(gh pr diff $PR_NUM -R $GITHUB_REPOSITORY)
+pr_diff=$(gh pr view $PR_NUM -R $GITHUB_REPOSITORY --json additions,deletions)
 
-insertions=$(printf "$pr_diff" | grep '^+' | wc -l)
-deletions=$(printf "$pr_diff" | grep '^-' | wc -l)
+additions=$(echo "$pr_diff" | jq -r '.additions')
+deletions=$(echo "$pr_diff" | jq -r '.deletions')
 
-total_changes=$((insertions + deletions))
+total_changes=$((additions + deletions))
 if [ "$total_changes" -lt "$MAX_SIZE" ]; then
     gh issue edit $PR_NUM --add-label $LABEL_NAME -R $GITHUB_REPOSITORY
 else

Reply via email to