mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
ci: Fix discussion answering github action workflow to escape the quote in the discussion content JSON
PiperOrigin-RevId: 805091905
This commit is contained in:
committed by
Copybara-Service
parent
e3422c616d
commit
43c96811da
@@ -42,4 +42,9 @@ jobs:
|
||||
REPO: 'adk-python'
|
||||
INTERACTIVE: 0
|
||||
PYTHONPATH: contributing/samples
|
||||
run: python -m adk_answering_agent.main --discussion '${{ toJson(github.event.discussion) }}'
|
||||
DISCUSSION_JSON: ${{ toJson(github.event.discussion) }}
|
||||
run: |
|
||||
# Replace single quotes with the sequence that allows them to be used in a single-quoted string
|
||||
# This replaces ' with '\'', which ends the current single-quoted string, adds an escaped single quote, then starts a new single-quoted string
|
||||
SAFE_JSON="${DISCUSSION_JSON//\'/\'\\\'\'}"
|
||||
python -m adk_answering_agent.main --discussion '$SAFE_JSON'
|
||||
|
||||
Reference in New Issue
Block a user