Skip to content

Commit

Permalink
Update size-label.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrivedi88 authored Jun 26, 2023
1 parent 2af19f4 commit 445668b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/size-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate size
run: |
git fetch
git fetch --update-shallow
git diff --stat HEAD~1
size=$(cat .git/FETCH_HEAD | wc -l)
if git rev-parse HEAD~1 >/dev/null 2>&1; then
git fetch origin main --update-shallow
git diff --stat HEAD~1
size=$(cat .git/FETCH_HEAD | wc -l)
else
echo "No previous comments"
size=0
fi
- name: Add label
run: |
if [ $size -gt 100 ]; then
Expand All @@ -28,5 +32,4 @@ jobs:
else
echo "Adding size: S"
hub label add ${{ github.head_repo.full_name }} ${{ github.head_ref }} "size: S"
fi
fi

0 comments on commit 445668b

Please sign in to comment.