Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 88aa257

Browse files
authored
Created size-label.yml
1 parent b47341a commit 88aa257

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

.github/workflows/size-label.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,21 @@ jobs:
2828
- name: Add label
2929
run: |
3030
if [ $size -gt 100 ]; then
31-
echo "Adding size: XXL"
32-
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
33-
-H "Accept: application/vnd.github.v3+json" \
34-
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
35-
-d '{"labels": ["size: XXL"], "color": "000000"}'
36-
elif [ $size -gt 50 ]; then
37-
echo "Adding size: XL"
38-
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
39-
-H "Accept: application/vnd.github.v3+json" \
40-
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
41-
-d '{"labels": ["size: XL"], "color": "FF0000"}'
42-
elif [ $size -gt 30 ]; then
4331
echo "Adding size: L"
4432
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
4533
-H "Accept: application/vnd.github.v3+json" \
4634
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
47-
-d '{"labels": ["size: L"], "color": "FFA500"}'
48-
elif [ $size -gt 10 ]; then
35+
--data '["size: L"]'
36+
elif [ $size -gt 30 ]; then
4937
echo "Adding size: M"
5038
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
5139
-H "Accept: application/vnd.github.v3+json" \
5240
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
53-
-d '{"labels": ["size: M"], "color": "FFFF00"}'
54-
elif [ $size -gt 5 ]; then
55-
echo "Adding size: S"
56-
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
57-
-H "Accept: application/vnd.github.v3+json" \
58-
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
59-
-d '{"labels": ["size: S"], "color": "00FF00"}'
41+
--data '["size: M"]'
6042
else
61-
echo "Adding size: XS"
43+
echo "Adding size: S"
6244
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
6345
-H "Accept: application/vnd.github.v3+json" \
6446
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
65-
-d '{"labels": ["size: XS"], "color": "0000FF"}'
47+
--data '["size: S"]'
6648
fi

0 commit comments

Comments
 (0)