Skip to content

fix: escape commit message in notify-ave-site client-payload - #145

Merged
chaksaray merged 1 commit into
developfrom
fix-notify-ave-site-json-escaping
Aug 8, 2026
Merged

chaksaray merged 1 commit into
developfrom
fix-notify-ave-site-json-escaping

Conversation

@chaksaray

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the Notify ave-site on records update workflow, which has been failing on every trigger since at least 2026-07-13.
  • Two independent bugs stacked here, found and fixed in sequence:
    1. AVE_SITE_DEPLOY_TOKEN didn't exist as a repo secret at all -- every run failed at token validation ("Parameter token or opts.auth is required") before ever reaching the payload. Now added (not part of this PR, done directly in repo settings).
    2. Once the token existed, re-running the last failed run surfaced a second, previously-masked bug: client-payload interpolates github.event.head_commit.message directly into a JSON string via "${{ ... }}". Multi-line commit messages (i.e. any commit with a trailer -- most commits in this repo) contain raw newlines, invalid inside a JSON string literal unless escaped, so the dispatch failed with Bad control character in string literal in JSON.
  • Fixed by switching to ${{ toJSON(github.event.head_commit.message) }}, which properly escapes newlines/quotes and already returns a quoted string, so the surrounding literal quotes are removed for that field.

Test plan

  • YAML parses (python3 -c "import yaml; yaml.safe_load(...)")
  • Once merged and synced to main, confirm the next records/** or schema/** push triggers a green run (previously reproduced the JSON error via gh run rerun against a real multi-line commit message on the current, unfixed workflow)

The workflow interpolated github.event.head_commit.message directly
into a JSON string literal via string substitution. Multi-line commit
messages (e.g. any commit with a trailer, which is most of them in
this repo) contain raw newlines, which are invalid inside a JSON
string literal unless escaped -- every run with a multi-line commit
message failed the dispatch with "Bad control character in string
literal in JSON". Switched to toJSON(), which properly escapes
newlines and quotes and already returns a quoted string, so the
surrounding literal quotes around that field are removed.

This was masked until now by a separate, unrelated failure: the
AVE_SITE_DEPLOY_TOKEN secret didn't exist at all, so every run failed
earlier at token validation before ever reaching the JSON payload.
Confirmed via re-run after the secret was added: token error gone,
this JSON error is what surfaced next.
@chaksaray
chaksaray merged commit 2fe60c5 into develop Aug 8, 2026
6 checks passed
@chaksaray
chaksaray deleted the fix-notify-ave-site-json-escaping branch August 8, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant