Skip to content

Commit 2a42dc1

Browse files
committed
Refactor category determination to use JSON format for labels
1 parent cc7e719 commit 2a42dc1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/issue_to_pr.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ jobs:
3838
- name: Determine category from labels
3939
id: determineCategory
4040
run: |
41-
echo "Labels: ${{ github.event.issue.labels.*.name }}"
41+
labels_json="${{ toJson(github.event.issue.labels) }}"
42+
echo "Labels: $labels_json"
4243
category=$(
43-
if [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'examples') ]]; then
44+
if [[ $(echo "$labels_json" | grep -q 'examples') ]]; then
4445
echo 'examples'
45-
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'mode') ]]; then
46+
elif [[ $(echo "$labels_json" | grep -q 'mode') ]]; then
4647
echo 'mode'
47-
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'tool') ]]; then
48+
elif [[ $(echo "$labels_json" | grep -q 'tool') ]]; then
4849
echo 'tool'
49-
elif [[ $(echo "${{ github.event.issue.labels.*.name }}" | grep -q 'library') ]]; then
50+
elif [[ $(echo "$labels_json" | grep -q 'library') ]]; then
5051
echo 'library'
5152
fi
5253
)

0 commit comments

Comments
 (0)