MINOR: the label action can't parse content having time format specifications (#17384)

Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
TaiJuWu 2024-10-07 10:47:30 +08:00 committed by GitHub
parent b4dd434f5e
commit e89fc4f5f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -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