From f1f7dc4e8acb45bf2ee60c99f408f975225cfabf Mon Sep 17 00:00:00 2001 From: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:21:20 +0530 Subject: [PATCH] Update size-label.yml --- .github/workflows/size-label.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 7d50eed6..78cad7a9 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -22,18 +22,27 @@ jobs: git diff --stat HEAD~1 size=$(cat .git/FETCH_HEAD | wc -l) else - echo "No previous comments" + echo "No previous commits" size=0 fi - name: Add label run: | if [ $size -gt 100 ]; then echo "Adding size: L" - hub label add ${{ github.head_repo.full_name }} ${{ github.head_ref }} "size: L" + curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \ + --data '["size: L"]' elif [ $size -gt 30 ]; then echo "Adding size: M" - hub label add ${{ github.head_repo.full_name }} ${{ github.head_ref }} "size: M" + curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \ + --data '["size: M"]' else echo "Adding size: S" - hub label add ${{ github.head_repo.full_name }} ${{ github.head_ref }} "size: S" - fi + curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \ + --data '["size: S"]' + fi