Using GitHub's REST API to update a release with a multi-line description -
i using json update description of github release list of commits release.
the problem if description has newline command fails with:
stdout: { stdout: "message": "problems parsing json", stdout: "documentation_url": "https://developer.github.com/v3" stdout: } the way got work replace newlines space:
def api_json = sprintf ('{"body": "%s"}', description.replace('\n',' ')); however, without newlines description difficult read. there way set description github release using api/json , keep newlines?
figured out answer, replace line break:
def api_json = sprintf ('{"body": "%s"}', description.replace('\n','<br />')); hope helps else :)
Comments
Post a Comment