diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 63b602e..fa23842 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -52,6 +52,17 @@ body: - High validations: required: true + - type: dropdown + id: complexity + attributes: + label: Complexity + description: A rough effort estimate. Small is a focused fix; Large spans many files or needs design. + options: + - Small + - Medium + - Large + validations: + required: true - type: input id: version attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 1c95bfd..20872a8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -41,3 +41,14 @@ body: - High validations: required: true + - type: dropdown + id: complexity + attributes: + label: Complexity + description: A rough effort estimate. Small is a focused change; Large spans many files or needs design. + options: + - Small + - Medium + - Large + validations: + required: true diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..b6e2778 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,39 @@ +name: Issue labeler + +# Rule 1.6 backstop: issue-form dropdown selections produce body TEXT under +# `### ` headings, not labels. This translates the Priority dropdown into +# the `priority: high` label. Complexity is intentionally a body field only, not +# a label (Rule 2.1), so it is not mapped here. + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + +jobs: + label: + name: Apply form labels + runs-on: ubuntu-latest + steps: + - name: Apply priority label from the issue form + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + BODY: ${{ github.event.issue.body }} + run: | + # Print the first non-empty line after a "### " line. + value_under() { + printf '%s\n' "$BODY" | awk -v h="### $1" ' + $0 == h { found = 1; next } + found && NF { print; exit } + ' + } + priority=$(value_under "Priority") + if [ "$priority" = "High" ]; then + gh issue edit "$NUMBER" --repo "$REPO" --add-label "priority: high" + else + gh issue edit "$NUMBER" --repo "$REPO" --remove-label "priority: high" || true + fi