Skip to content

Commit

Permalink
ci: fix bug that labels are not created (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k authored Aug 18, 2024
1 parent cd1ac4d commit 8177246
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ jobs:
run: |
EXISTING_LABELS=$(gh label list --json name --jq '.[].name')
if ! echo "$EXISTING_LABELS" | grep -q "$MINOR_LABEL"; then
if ! echo "$EXISTING_LABELS" | grep -qx "$MINOR_LABEL"; then
gh label create "$MINOR_LABEL" --color "$MINOR_LABEL_COLOR"
fi
if ! echo "$EXISTING_LABELS" | grep -q "$MAJOR_LABEL"; then
if ! echo "$EXISTING_LABELS" | grep -qx "$MAJOR_LABEL"; then
gh label create "$MAJOR_LABEL" --color "$MAJOR_LABEL_COLOR"
fi
if ! echo "$EXISTING_LABELS" | grep -q "$PATCH_LABEL"; then
if ! echo "$EXISTING_LABELS" | grep -qx "$PATCH_LABEL"; then
gh label create "$PATCH_LABEL" --color "$PATCH_LABEL_COLOR"
fi
- name: Manage labels based on PR title
Expand All @@ -77,9 +77,9 @@ jobs:
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
HAS_MINOR_LABEL=$(echo "$LABELS" | grep -q "$MINOR_LABEL" && echo "true" || echo "false")
HAS_MAJOR_LABEL=$(echo "$LABELS" | grep -q "$MAJOR_LABEL" && echo "true" || echo "false")
HAS_PATCH_LABEL=$(echo "$LABELS" | grep -q "$PATCH_LABEL" && echo "true" || echo "false")
HAS_MINOR_LABEL=$(echo "$LABELS" | grep -qx "$MINOR_LABEL" && echo "true" || echo "false")
HAS_MAJOR_LABEL=$(echo "$LABELS" | grep -qx "$MAJOR_LABEL" && echo "true" || echo "false")
HAS_PATCH_LABEL=$(echo "$LABELS" | grep -qx "$PATCH_LABEL" && echo "true" || echo "false")
if [ "$HAS_MAJOR_LABEL" = "true" ]; then
if [ "$HAS_PATCH_LABEL" = "true" ];then
Expand Down

0 comments on commit 8177246

Please sign in to comment.