Skip to content

Commit 7ff846f

Browse files
authored
Merge pull request #48 from Stefterv/main
Simplified Label check
2 parents d5b14cb + 67a3c2d commit 7ff846f

File tree

2 files changed

+5
-73
lines changed

2 files changed

+5
-73
lines changed

.github/workflows/issue_to_pr.yml

+5-41
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,15 @@ jobs:
3636
- name: Install dependencies
3737
run: pip install -r requirements.txt
3838

39-
- name: Get issue labels
40-
id: getLabels
41-
env:
42-
GH_TOKEN: ${{ github.token }}
43-
run: |
44-
labels=$(gh issue view "${{ github.event.issue.number }}" --json labels -q '.labels|map(.name)')
45-
echo "Labels: $labels"
46-
echo "labels=$labels" >> $GITHUB_ENV
47-
48-
- name: Determine category from labels
49-
id: determineCategory
50-
run: |
51-
labels_json='${{ env.labels }}'
52-
echo "Labels: $labels_json"
53-
category=$(python scripts/determine_category.py "$labels_json")
54-
if [ -z "$category" ]; then
55-
echo "Category is empty. Please ensure the issue has a valid label."
56-
exit 1
57-
fi
58-
echo "category=$category" >> $GITHUB_OUTPUT
59-
echo "Category found: $category"
60-
61-
- name: Debug payload
62-
run: echo "${{ steps.parseIssue.outputs.payload }}"
63-
64-
- name: Validate properties URL
65-
id: validateUrl
66-
run: |
67-
properties_url="${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
68-
if [ -z "$properties_url" ]; then
69-
echo "Properties URL is empty. Please provide a valid URL."
70-
exit 1
71-
fi
72-
if ! curl --output /dev/null --silent --head --fail "$properties_url"; then
73-
echo "Url not valid: $properties_url"
74-
exit 1
75-
fi
76-
7739
- name: Read and validate properties txt file
7840
id: parseProps
7941
run: |
80-
properties_url="${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
8142
python -u scripts/parse_and_validate_properties_txt.py \
82-
${{ steps.determineCategory.outputs.category }} \
83-
"$properties_url"
43+
"${{ contains(github.event.issue.labels.*.name, 'library') && 'library' ||
44+
contains(github.event.issue.labels.*.name, 'tools') && 'tool' ||
45+
contains(github.event.issue.labels.*.name, 'mode') && 'mode' ||
46+
contains(github.event.issue.labels.*.name, 'examples') && 'examples' }}" \
47+
"${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
8448
8549
- name: add comment to issue
8650
id: issueComment

scripts/determine_category.py

-32
This file was deleted.

0 commit comments

Comments
 (0)