If you used ${{ ... }} in the data: block it will break the JSON output because the whole content will be send quoted and so all quotes inside are escaped
name: Some Test
on:
workflow_dispatch:
run-name: ${{ github.actor}} some test
jobs:
debug:
name: Some test
runs-on: ubuntu-latest
steps:
- name: ome Test
env:
test_secret: ${{ secrets.TEST_SECRET }}
test_variable: ${{ vars.TEST_VARIABLE }}
uses: fjogeleit/http-request-action@v1
with:
url: 'https://some.url/target/'
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data:
'{
"test_secret": "${{ secrets.TEST_SECRET }}",
"test_variable_a": "${{ env.test_variable }}",
"test_variable_b": "${{ vars.TEST_VARIABLE }}",
"foo": "bar",
"krampf": "wanz"
}'
The output from above will be:
"{ \"test_secret\": \"This is a secret\", \"test_variable_a\": \"This is a variable\", \"test_variable_b\": \"This is a variable\", \"foo\": \"bar\", \"krampf\": \"wanz\" }"
If the ${{ ... }} blocks are removed
{ "foo": "bar", "krampf": "wanz" }
If you used ${{ ... }} in the data: block it will break the JSON output because the whole content will be send quoted and so all quotes inside are escaped
The output from above will be:
"{ \"test_secret\": \"This is a secret\", \"test_variable_a\": \"This is a variable\", \"test_variable_b\": \"This is a variable\", \"foo\": \"bar\", \"krampf\": \"wanz\" }"If the ${{ ... }} blocks are removed
{ "foo": "bar", "krampf": "wanz" }