Skip to content

Commit 696b6ad

Browse files
committed
fix(ci): quote SHARE_CTX_THREAD - YAML hash-comment truncation
"PR #{0}" inside an UNQUOTED plain scalar hits the YAML comment marker (" #"): the value truncates mid-expression, leaving an unterminated ${{ - the workflow file goes INVALID (red X with 0 jobs on every push since aa890c9, and dispatch could not have parsed). Quote the whole value; the other three workflows were already quoted. Battery-pinned (hash trap).
1 parent 3d7fb4d commit 696b6ad

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/scripts/scrub-fixtures.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ for wf in pr-review bot-reply compliance-check issue-comment; do
160160
# opencode prints the share link on STDERR (TUI/status channel): the
161161
# merge is load-bearing - without 2>&1 the link bypasses the filter.
162162
check "share: $wf merges stderr into filter" yes "$(grep -q 'opencode run --share.*2>&1 | bash /tmp/share-filter.sh' "$WFF" && echo yes || echo no)"
163+
# "PR #{0}" inside an UNQUOTED scalar truncates the value at the YAML
164+
# comment marker (" #") - the workflow file goes invalid and every push
165+
# red-Xes with 0 jobs (live-caught on bot-reply). Values carrying # in
166+
# expressions must be quoted.
167+
check "share: $wf SHARE_CTX values quoted (hash trap)" no "$(grep -E 'SHARE_CTX_[A-Z]+: [^\"'\"']' "$WFF" | grep -q '\$\{{' && echo yes || echo no)"
163168
check "share: $wf passes SHARE_LINK_PUBKEY env" yes "$(grep -q 'SHARE_LINK_PUBKEY: \${{ secrets.SHARE_LINK_PUBKEY }}' "$WFF" && echo yes || echo no)"
164169
check "share: $wf copies filter to /tmp" yes "$(grep -q 'cp .github/scripts/share-filter.sh /tmp/share-filter.sh' "$WFF" && echo yes || echo no)"
165170
check "share: $wf has summary step" yes "$(grep -q 'Share link summary' "$WFF" && echo yes || echo no)"

.github/workflows/bot-reply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ jobs:
677677
# with the admin - see decrypt_share_link.py). Context fields are
678678
# public metadata identifying which session this is.
679679
SHARE_LINK_PUBKEY: ${{ secrets.SHARE_LINK_PUBKEY }}
680-
SHARE_CTX_THREAD: ${{ steps.context.outputs.IS_PR == 'true' && format('PR #{0}', env.THREAD_NUMBER) || format('Issue #{0}', env.THREAD_NUMBER) }}
680+
SHARE_CTX_THREAD: "${{ steps.context.outputs.IS_PR == 'true' && format('PR #{0}', env.THREAD_NUMBER) || format('Issue #{0}', env.THREAD_NUMBER) }}"
681681
SHARE_CTX_HEAD: ${{ env.PR_HEAD_SHA }}
682682
SHARE_CTX_DETAIL: agent reply
683683
run: |

0 commit comments

Comments
 (0)