From 9c6be5bfe7d80010c366238465ab8050531eefa4 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 14 Oct 2025 11:25:18 +0100 Subject: [PATCH] ci(.github/workflows/traiage.yaml): explicitly fetch comments in gh cli invocation (#20288) Closes https://github.com/coder/internal/issues/1053 Updated the `gh` command to fetch issue description with explicit JSON fields and formatting. Validated with manual workflow run: https://github.com/coder/coder/actions/runs/18492815891/job/52690197479 Agent picked up additional instruction from comments: https://github.com/coder/coder/compare/cian/traiage-gh-20085-18492815891 Screenshot 2025-10-14 at 11 02 36 --- .github/workflows/traiage.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/traiage.yaml b/.github/workflows/traiage.yaml index 566cfc7841..2749e07a4f 100644 --- a/.github/workflows/traiage.yaml +++ b/.github/workflows/traiage.yaml @@ -189,7 +189,10 @@ jobs: TEMPLATE_PRESET: ${{ steps.determine-inputs.outputs.template_preset }} run: | # Fetch issue description using `gh` CLI - issue_description=$(gh issue view "${ISSUE_URL}") + #shellcheck disable=SC2016 # The template string should not be subject to shell expansion + issue_description=$(gh issue view "${ISSUE_URL}" \ + --json 'title,body,comments' \ + --template '{{printf "%s\n\n%s\n\nComments:\n" .title .body}}{{range $k, $v := .comments}} - {{index $v.author "login"}}: {{printf "%s\n" $v.body}}{{end}}') # Write a prompt to PROMPT_FILE PROMPT=$(cat <