Files
pnpm/.github/scripts/issue-fix-intent.test.sh
Zoltan KochanandClaude Opus 5.5 c4ecac2da2 chore(github): ask issue authors without the fix checkbox about a PR (#16271)
* chore(github): ask issue authors without the fix checkbox about a PR

Issues filed through `gh issue create --body` or the API skip the issue
form, so they never carry the "I am working on a fix" checkbox. When the
"Contributing a fix" section is missing from the body, the triage
workflow now comments asking the author whether they plan to open a
pull request. The regression form gets the same checkbox, so its
reports are not asked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(github): cover the issue fix-intent classifier

The classifier moves from the triage workflow into
.github/scripts/issue-fix-intent.sh, with a test that CI runs next to the
other workflow script tests. The workflow checks out the default branch
before the step so the script is available.

A "Contributing a fix" heading without its checkbox now counts as
missing. A hand-written body containing only the heading was classified
as unchecked and got neither an assignment nor the question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 16:24:16 +02:00

25 lines
979 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
assert_intent() {
local expected=$1
local body=$2
local actual
actual=$("$script_dir/issue-fix-intent.sh" <<< "$body")
if [ "$actual" != "$expected" ]; then
printf 'expected %s, got %s for body:\n%s\n' "$expected" "$actual" "$body" >&2
exit 1
fi
}
assert_intent checked $'### Describe the Bug\n\nIt breaks.\n\n### Contributing a fix\n\n- [x] I am working on a fix'
assert_intent checked $'### Contributing a fix\r\n\r\n- [X] I am working on a fix\r'
assert_intent unchecked $'### Describe the Bug\n\nIt breaks.\n\n### Contributing a fix\n\n- [ ] I am working on a fix'
assert_intent missing $'### Describe the Bug\n\nIt breaks.\n\nA fix is prepared and will be submitted as a PR shortly.'
assert_intent missing $'### Describe the Bug\n\n- [x] I am working on a fix'
assert_intent missing $'### Contributing a fix\n\nI will send a PR.'
assert_intent missing ''