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

Commit 9e55e2c

Browse files
authored
Update size-label.yml
1 parent cc86cc1 commit 9e55e2c

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/workflows/size-label.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,39 @@ jobs:
2828
- name: Add label
2929
run: |
3030
if [ $size -gt 100 ]; then
31-
echo "Adding size: L"
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+
--data '{"labels": ["size: XXL"], "color": "000000"}'
36+
elif [ $size -gt 50 ]; then
37+
echo "Adding size: XL"
3238
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
3339
-H "Accept: application/vnd.github.v3+json" \
3440
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
35-
--data '["size: L"]'
41+
--data '{"labels": ["size: XL"], "color": "FF0000"}'
3642
elif [ $size -gt 30 ]; then
43+
echo "Adding size: L"
44+
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
45+
-H "Accept: application/vnd.github.v3+json" \
46+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
47+
--data '{"labels": ["size: L"], "color": "FFA500"}'
48+
elif [ $size -gt 10 ]; then
3749
echo "Adding size: M"
3850
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
3951
-H "Accept: application/vnd.github.v3+json" \
4052
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
41-
--data '["size: M"]'
42-
else
53+
--data '{"labels": ["size: M"], "color": "FFFF00"}'
54+
elif [ $size -gt 5 ]; then
4355
echo "Adding size: S"
4456
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
4557
-H "Accept: application/vnd.github.v3+json" \
4658
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
47-
--data '["size: S"]'
59+
--data '{"labels": ["size: S"], "color": "00FF00"}'
60+
else
61+
echo "Adding size: XS"
62+
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
63+
-H "Accept: application/vnd.github.v3+json" \
64+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
65+
--data '{"labels": ["size: XS"], "color": "0000FF"}'
4866
fi

0 commit comments

Comments
 (0)