Skip to content

Triage new issues

An issue that says “checkout is slow” can’t be started until someone asks what it means. Here you label those issues as they arrive.

You need decide installed, an API key, and a GitHub repository where you can add a workflow.

decide’s repository has six sample issues, some clear and some vague:

Terminal window
git clone --depth 1 https://github.com/deepnoodle-ai/decide
cd decide/demo

task-readiness asks whether an issue is ready to start, and how large it is. Run it on the six issues, then show the three nearest a flag:

~/decide/demo
decide run task-readiness issues.json > /dev/null
decide runs view --top 3
Output as text
$ decide run task-readiness issues.json > /dev/null
Running task-readiness on 6 records · typesafe jev-latest

✓ 6 answered  ! 3 flagged  200ms
Flagged: issues.json[1], issues.json[3], issues.json[5]
See these results again with: decide runs view 20261112-170445-aa80
$ decide runs view --top 3
Run 20261112-170445-aa80 · task-readiness on issues.json · 1 second ago

issues.json[3]  {"number":104,"title":"Move to multi-currency billing","b…
! ready  no      96%
! size   large   100%

issues.json[1]  {"number":102,"title":"Checkout is slow","body":"Customer…
! ready  no      98%
  size   large   54%

issues.json[5]  {"number":106,"title":"Update the docs","body":"The docs …
! ready  no      98%
  size   medium  49%

The 3 of 6 answered items nearest their flags, flagged ones first.
✓ 6 answered  ! 3 flagged
Flagged: issues.json[1], issues.json[3], issues.json[5]

Three of six issues are flagged as not ready. Each says what is wrong but not what to change, or how to tell when it’s done.

Add your key as a repository secret named TYPESAFE_API_KEY, and create a not-ready label. Then save this as .github/workflows/triage.yml:

.github/workflows/triage.yml
name: triage
on:
issues:
types: [opened]
permissions:
issues: write
jobs:
readiness:
runs-on: ubuntu-latest
steps:
- name: Install decide
7 collapsed lines
run: |
base=https://github.com/deepnoodle-ai/decide/releases/latest/download
curl -fsSLO "$base/decide_linux_amd64.tar.gz"
curl -fsSLO "$base/checksums.txt"
sha256sum --check --ignore-missing checksums.txt
tar -xzf decide_linux_amd64.tar.gz decide
sudo mv decide /usr/local/bin/
- name: Label the issue if it isn't ready
env:
TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
GH_TOKEN: ${{ github.token }}
TITLE: ${{ github.event.issue.title }}
BODY: ${{ github.event.issue.body }}
NUMBER: ${{ github.event.issue.number }}
run: |
status=0
printf '%s\n\n%s\n' "$TITLE" "$BODY" |
decide run task-readiness --each file --fail-on flagged ||
status=$?
if [ "$status" -eq 2 ]; then
gh issue edit "$NUMBER" --repo "$GITHUB_REPOSITORY" --add-label not-ready
elif [ "$status" -ne 0 ]; then
exit "$status"
fi

Keep the issue’s text in env, as above. Written into the script as ${{ github.event.issue.body }}, an issue’s text could run commands.

Each new issue is one request on your key.

Run the workflow’s command on a vague issue, and print the exit code:

~/decide/demo
TITLE='Checkout is slow'; BODY='Customers say checkout feels slow.'
printf '%s\n\n%s\n' "$TITLE" "$BODY" |
  decide run task-readiness --each file --fail-on flagged
echo $?
Output as text
$ TITLE='Checkout is slow'; BODY='Customers say checkout feels slow.'
$ printf '%s\n\n%s\n' "$TITLE" "$BODY" |
>   decide run task-readiness --each file --fail-on flagged
Running task-readiness on 1 file · typesafe jev-latest

stdin
! ready  no      99%
  size   small   45%

✓ 1 answered  ! 1 flagged  100ms
See these results again with: decide runs view 20261112-170421-a2ba
Exiting with code 2 because 1 item was flagged (--fail-on flagged)
$ echo $?
2

The issue is flagged, and decide exits with code 2, so the workflow adds the label.

decide is Apache 2.0. Made by Deep Noodle, after some very hard thinking.