Skip to content

Commit

Permalink
Refactor category determination to use JSON format for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
SableRaf committed Jan 11, 2025
1 parent cc7e719 commit 2a42dc1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/issue_to_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ jobs:
- name: Determine category from labels
id: determineCategory
run: |
echo "Labels: ${{ github.event.issue.labels.*.name }}"
labels_json="${{ toJson(github.event.issue.labels) }}"
echo "Labels: $labels_json"
category=$(
if [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'examples') ]]; then
if [[ $(echo "$labels_json" | grep -q 'examples') ]]; then
echo 'examples'
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'mode') ]]; then
elif [[ $(echo "$labels_json" | grep -q 'mode') ]]; then
echo 'mode'
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'tool') ]]; then
elif [[ $(echo "$labels_json" | grep -q 'tool') ]]; then
echo 'tool'
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'library') ]]; then
elif [[ $(echo "$labels_json" | grep -q 'library') ]]; then
echo 'library'
fi
)
Expand Down

0 comments on commit 2a42dc1

Please sign in to comment.