Closed josiahcoad closed 1 week ago
Hi! I'll check you case. Do you think "'" has been used in a PR's title?
But one of my PR's has a "'" in it so I think that is causing issue.
@AlexSim93
P.S. Thanks for making this. It's awesome!
I tested the action's behavior when a '
character is used in the title. This does not affect the action's performance, and the error occurs at subsequent steps where the action has no further influence. I did some research, and as I understand, one approach is to convert the JSON into a file and work with it afterward. Alternatively, other escaping methods can be used. I will consider generating a file, but when it comes to the collection
type, there isn't anything I can change here.
Finally figured it out! You have to assign it to a variable (thanks to this guy).
DATA: ${{ steps.analytics.outputs.JSON_COLLECTION }}
run: |
echo "$DATA" > collection.json
curl -X POST -H "Content-Type: application/json" -d @collection.json $WEBHOOK_URL
Note that just writing it to a file via echo '${{ steps.analytics.outputs.JSON_COLLECTION }}' > collection.json
doesn't work for the same reason.
-
Is your feature request related to a problem? Please describe. Yes, I am trying to export the json (to send to a webhook) and it seems that the string is not properly escaped.
Describe the solution you'd like I'd like the json string to be properly escaped so that I can send it in the webook
Describe alternatives you've considered my current action step after the analytics action contains:
curl -X POST -H "Content-Type: application/json" -d '${{ steps.analytics.outputs.JSON_COLLECTION }}' $WEBHOOK_URL
But one of my PR's has a "'" in it so I think that is causing issue.
Additional context error:
unexpected EOF while looking for matching ``'