curl
curl copied to clipboard
How to give json data in the args section?
Getting error " mapping values are not allowed in this context" while having workflow as given below < on: push jobs: curl: runs-on: ubuntu-latest steps: - name: curl uses: wei/curl@master with: args: -vvf -uxxxxxxxxxxxxxxxxxxxxx -H "Content-Type: application/json" -X POST https://api.bintray.com/packages/chiju/rpms/openssh/versions --data '{"name": "7.6", "github_use_tag_release_notes": false }'
Need.
Same problem Thanks
Your problem is in your YAML syntax not this action.
: isn't normally something you need to worry about in YAML but : followed by a space becomes a key separator. You need to escape the space, for example in your script you need to escape the content type but with the data you can just remove the spaces.
args: -vvf -uxxxxxxxxxxxxxxxxxxxxx -H "Content-Type:\ application/json" -X POST https://api.bintray.com/packages/chiju/rpms/openssh/versions --data '{"name":"7.6", "github_use_tag_release_notes":false }'
Try a YAML parser to find issues in future and read this StackOverflow post if you want more info.
Your problem is in your YAML syntax not this action.
:isn't normally something you need to worry about in YAML but:followed by a space becomes a key separator. You need to escape the space, for example in your script you need to escape the content type but with the data you can just remove the spaces.args: -vvf -uxxxxxxxxxxxxxxxxxxxxx -H "Content-Type:\ application/json" -X POST https://api.bintray.com/packages/chiju/rpms/openssh/versions --data '{"name":"7.6", "github_use_tag_release_notes":false }'Try a YAML parser to find issues in future and read this StackOverflow post if you want more info.
Saved my hours.
Please guys don't hurt yourself during 1 day like me. I want peace.
- name: Patch Scaleway Serverless container front
uses: wei/curl@v1
with:
args: --location --request PATCH https://api.scaleway.com/containers/v1beta1/regions/fr-par/containers/3ccb12f1-7775-405f-8685-6ecb3021df89 --header \'X-Auth-Token:\ ${{ secrets.SCW_SECRET_TOKEN }}\' --header \'Content-Type:\ application/json\' --data-raw \'{\"registry_image\":\ \"rg.fr-par.scw.cloud/funcscwlandingpaget9xrgx1y/landingpagefront:${{ github.ref_name }}\"}\'
This thing works like a charm for me
- name: Patch Scaleway Serverless container front
uses: wei/curl@v1
with:
args: --location --request PATCH https://api.scaleway.com/containers/v1beta1/regions/fr-par/containers/5ad8c796-8cda-4db1-8eb6-60d295f8ed73 --header 'X-Auth-Token:${{ secrets.SCW_SECRET_TOKEN }}' --header 'Content-Type:application/json' --data-raw '{\"registry_image\":\"rg.fr-par.scw.cloud/funcscwlandingpagefn3xcuzy/landingpagefront:${{ github.ref_name }}\"}'