workflow-dispatch
workflow-dispatch copied to clipboard
Unexpected token error for json input
I am working on GitHub actions, and I have a case where I need to send a multiline string as json. I am getting some unexpected token error.
This is my test.md and workflow:
---------------------------
**test**
- update something
- another update
**test2**
- Add `test` to param
steps:
- uses: actions/checkout@v2
- name: Get Log
id: getLog
run: |
CHANGELOG="$(cat test.md)"
CHANGELOG="$($CHANGELOG//'%'/'%25')"
CHANGELOG="$($CHANGELOG//$'\n'/'%0A')"
CHANGELOG="$($CHANGELOG//$'\r'/'%0D')"
echo "::set-output name=changeLog::$CHANGELOG"
- name: Invoke CLI workflow with changelog
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Workflow publish
token: ${{ secrets.TOKEN }}
repo: repo/name
inputs: '{ "changeLog": "${{steps.getLog.outputs.changeLog}}"}'
I am getting an unexpected token error. How solve this?
Thanks in advance