Skip to content

Commit 0735a1c

Browse files
committed
workflows: Fix broken protected-files override expression
The && ternary idiom (cond && 'allowed' || 'request_review') broke drafter.lock.yml and fix.lock.yml outright: gh-aw's compiler JSON-encodes this policy string with Go's default HTML-escaping, turning the literal && into \u0026\u0026 inside the heredoc-embedded config blob. GitHub Actions' expression parser can't parse that, so the whole workflow file was rejected as invalid on push -- see https://github.com/cgwalters/gh-aw-fullsend-mini/actions/runs/30547055376 (zero jobs even attempted; both drafter.md and fix.md were effectively disabled since the merge of #20). Switch to GitHub Actions' case() function, which expresses the same if/else without &, <, or > -- the only characters Go's json.Marshal HTML-escapes by default -- so it survives gh-aw's config serialization intact. Assisted-by: https://github.com/cgwalters/cgwalters#llms
1 parent 50f91dd commit 0735a1c

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/drafter.lock.yml

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

.github/workflows/drafter.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ safe-outputs:
3838
# this specific run to edit them without that gate. This must not become
3939
# the default — see "Letting the agent edit protected files" in README.md.
4040
protected-files:
41-
policy: ${{ contains(github.event.issue.labels.*.name, 'agent/workflow-edits-allowed') && 'allowed' || 'request_review' }}
41+
# case(), not "cond && 'allowed' || 'request_review'": gh-aw's compiler
42+
# JSON-encodes this string with Go's default HTML-escaping, which turns
43+
# a literal && into \u0026\u0026 and produces an expression GitHub
44+
# Actions can't parse (silently breaking the whole workflow file at
45+
# push time, no job even attempts to run). case() has no &, <, or >,
46+
# so it survives that encoding intact.
47+
policy: ${{ case(contains(github.event.issue.labels.*.name, 'agent/workflow-edits-allowed'), 'allowed', 'request_review') }}
4248

4349
timeout-minutes: 15
4450
---

0 commit comments

Comments
 (0)