Skip to content

Commit

Permalink
Merge pull request #48 from Stefterv/main
Browse files Browse the repository at this point in the history
Simplified Label check
  • Loading branch information
Stefterv authored Jan 13, 2025
2 parents d5b14cb + 67a3c2d commit 7ff846f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 73 deletions.
46 changes: 5 additions & 41 deletions .github/workflows/issue_to_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,51 +36,15 @@ jobs:
- name: Install dependencies
run: pip install -r requirements.txt

- name: Get issue labels
id: getLabels
env:
GH_TOKEN: ${{ github.token }}
run: |
labels=$(gh issue view "${{ github.event.issue.number }}" --json labels -q '.labels|map(.name)')
echo "Labels: $labels"
echo "labels=$labels" >> $GITHUB_ENV
- name: Determine category from labels
id: determineCategory
run: |
labels_json='${{ env.labels }}'
echo "Labels: $labels_json"
category=$(python scripts/determine_category.py "$labels_json")
if [ -z "$category" ]; then
echo "Category is empty. Please ensure the issue has a valid label."
exit 1
fi
echo "category=$category" >> $GITHUB_OUTPUT
echo "Category found: $category"
- name: Debug payload
run: echo "${{ steps.parseIssue.outputs.payload }}"

- name: Validate properties URL
id: validateUrl
run: |
properties_url="${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
if [ -z "$properties_url" ]; then
echo "Properties URL is empty. Please provide a valid URL."
exit 1
fi
if ! curl --output /dev/null --silent --head --fail "$properties_url"; then
echo "Url not valid: $properties_url"
exit 1
fi
- name: Read and validate properties txt file
id: parseProps
run: |
properties_url="${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
python -u scripts/parse_and_validate_properties_txt.py \
${{ steps.determineCategory.outputs.category }} \
"$properties_url"
"${{ contains(github.event.issue.labels.*.name, 'library') && 'library' ||
contains(github.event.issue.labels.*.name, 'tools') && 'tool' ||
contains(github.event.issue.labels.*.name, 'mode') && 'mode' ||
contains(github.event.issue.labels.*.name, 'examples') && 'examples' }}" \
"${{ fromJson(steps.parseIssue.outputs.payload)['Properties File URL'] }}"
- name: add comment to issue
id: issueComment
Expand Down
32 changes: 0 additions & 32 deletions scripts/determine_category.py

This file was deleted.

0 comments on commit 7ff846f

Please sign in to comment.