Skip to content

Commit 3f21f52

Browse files
authored
fix: convert double quotes to single quotes in experiment comparison expressions (#31770)
1 parent e7063a4 commit 3f21f52

8 files changed

Lines changed: 182 additions & 39 deletions

.github/workflows/daily-fact.lock.yml

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-fact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Mine recent activity from the repository to find interesting facts. Focus on:
9999
## Guidelines
100100

101101
- **Check memory first**: Skip any PR, issue, or release that already appears in the palace results from Step 0
102-
{{#if experiments.reasoning_depth == "multi_candidate"}}
102+
{{#if experiments.reasoning_depth == 'multi_candidate'}}
103103
- **Multi-candidate deliberation**: Before writing, identify exactly **3 distinct candidate facts** (one PR, one issue or release, one contributor or pattern). For each candidate write one sentence on why it is novel today. Then score each candidate 1–5 on: (a) novelty vs palace memory, (b) intrinsic poetic potential. Select the highest-scoring candidate and write the verse for that one only.
104104
{{else}}
105105
- **Favor recent updates** but include variety - pick something interesting, not just the most recent

pkg/workflow/compiler_orchestrator_frontmatter.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88

9+
"github.com/github/gh-aw/pkg/console"
910
"github.com/github/gh-aw/pkg/logger"
1011
"github.com/github/gh-aw/pkg/parser"
1112
)
@@ -141,6 +142,15 @@ func (c *Compiler) parseFrontmatterSection(markdownPath string) (*frontmatterPar
141142
return nil, fmt.Errorf("template condition validation failed: %w", err)
142143
}
143144

145+
// Warn when experiment comparison expressions use double-quoted string literals.
146+
// GitHub Actions expression syntax only supports single-quoted string literals, so
147+
// the compiler converts double quotes to single quotes automatically — but authors
148+
// should fix the source to use single quotes to keep it consistent with the output.
149+
for _, w := range detectDoubleQuotedExperimentComparisons(result.Markdown) {
150+
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(w))
151+
c.IncrementWarningCount()
152+
}
153+
144154
log.Printf("Frontmatter: %d chars, Markdown: %d chars", len(result.Frontmatter), len(result.Markdown))
145155

146156
return &frontmatterParseResult{

pkg/workflow/compiler_template_validation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ permissions:
150150
strict: false
151151
---
152152
153-
{{#if experiments.prompt_style == "detailed"}}
153+
{{#if experiments.prompt_style == 'detailed'}}
154154
detailed prompt
155155
{{else}}
156156
concise prompt

0 commit comments

Comments
 (0)