Using ruff version 0.16.0 breaks things #77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Issue | |
| on: | |
| issues: | |
| types: [opened, edited] | |
| jobs: | |
| set-issue-field: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Update Issue Priority | |
| env: | |
| GH_TOKEN: ${{ secrets.PROJECT_TOKEN }} | |
| ISSUE_BODY: ${{ github.event.issue.body }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| set -euo pipefail | |
| # Extract Priority from the Issue Form. | |
| PRIORITY=$(printf '%s\n' "$ISSUE_BODY" | | |
| awk ' | |
| /^### Priority$/ { | |
| found = 1 | |
| next | |
| } | |
| found && NF { | |
| exit | |
| } | |
| ' | | |
| xargs) | |
| echo "Priority: $PRIORITY" | |
| case "$PRIORITY" in | |
| Low|Medium|High|Urgent) | |
| ;; | |
| *) | |
| echo "Invalid or missing priority: '$PRIORITY'" | |
| exit 1 | |
| ;; | |
| esac | |
| # Find the organization Issue Field named "Priority". | |
| FIELD_ID=$(gh api \ | |
| "/orgs/pennaerial/issue-fields" | | |
| jq -r ' | |
| .[] | |
| | select(.name == "Priority") | |
| | .id | |
| ') | |
| if [ -z "$FIELD_ID" ] || [ "$FIELD_ID" = "null" ]; then | |
| echo "Issue Field 'Priority' not found." | |
| exit 1 | |
| fi | |
| echo "Priority field ID: $FIELD_ID" | |
| # Set the Issue Field value. | |
| gh api \ | |
| --method PUT \ | |
| "/repos/$REPO/issues/$ISSUE_NUMBER/issue-field-values" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2026-03-10" \ | |
| --input - <<EOF | |
| { | |
| "issue_field_values": [ | |
| { | |
| "field_id": $FIELD_ID, | |
| "value": "$PRIORITY" | |
| } | |
| ] | |
| } | |
| EOF | |
| echo "Successfully set Issue Priority to '$PRIORITY'." |