From 7efb1a7b44ac9d27ae6686e4643ac34ee6457ace Mon Sep 17 00:00:00 2001 From: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:06:07 +0530 Subject: [PATCH] Update size-label.yml --- .github/workflows/size-label.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 78cad7a9..187d0f2e 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -28,21 +28,39 @@ jobs: - name: Add label run: | if [ $size -gt 100 ]; then - echo "Adding size: L" + echo "Adding size: XXL" + 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 \ + -d '["size: XXL"]' + elif [ $size -gt 50 ]; then + echo "Adding size: XL" 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"]' + -d '["size: XL"]' elif [ $size -gt 30 ]; then + echo "Adding 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 \ + -d '["size: L"]' + elif [ $size -gt 10 ]; then echo "Adding 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 + -d '["size: M"]' + elif [ $size -gt 5 ]; then echo "Adding size: S" 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"]' + -d '["size: S"]' + else + echo "Adding size: XS" + 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 \ + -d '["size: XS"]' fi