From 0c105aff8a70e6beeba9d4d4302edea117bad2c6 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 21 Jul 2025 15:51:48 -0400 Subject: [PATCH] Use gh go templating for user prompt `gh` has Go templating support built in, so let's use it. --- .../workflows/scripts/spam-detection/check-issue.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scripts/spam-detection/check-issue.sh b/.github/workflows/scripts/spam-detection/check-issue.sh index 9f3ca1a54..2f82eb4ea 100755 --- a/.github/workflows/scripts/spam-detection/check-issue.sh +++ b/.github/workflows/scripts/spam-detection/check-issue.sh @@ -20,17 +20,17 @@ if [[ -z "$_issue_url" ]]; then exit 1 fi -_issue="$(gh issue view --json title,body "$_issue_url")" - -cat << EOF | _user_prompt +_user_prompt_template=' -$(jq -r ".title" <<< "$_issue") +{{ .title }} -$(jq -r ".body" <<< "$_issue") +{{ .body }} -EOF +' + +_user_prompt="$(gh issue view --json title,body --template "$_user_prompt_template" "$_issue_url")" # Generate dynamic prompts for inference _system_prompt="$($SPAM_DIR/generate-sys-prompt.sh)"