releases
releases copied to clipboard
Release body being inserted as raw markdown
What Happened
The markdown formatting, it's gone!
Steps to Reproduce
The only difference I can see is that Danielle made the releases for the repos that aren't working, as opposed to the bot. All of the repos with user-created releases have the issue, but Calendar and Appcenter are the others I spotted that have side-by-side releases with the bug.
Assign me that issue Thanks
assign me that issue thanks
This inconsistency comes from GitHub actions outputting results from https://github.com/elementary/actions/blob/8522acaed6fd21d7854015dce74ebc76514d7590/release/entrypoint.sh#L57 which pulls the xml data from the appdata.xml
file https://github.com/elementary/sideload/blob/1bce9873214f97fdd075f3673c77e8d60c101c66/data/sideload.appdata.xml.in#L46-L53. This XML data happens to also be valid HTML, so it gets displayed properly.
One solution to parse the markdown would be to pass the request back to the GitHub API using the requests python package. It could probably go somewhere around here: https://github.com/elementary/releases/blob/bcba6f5257e620b4abaaf37829c9f9585a4ffed7/release.py#L57
headers = {
"Accept": "application/vnd.github+json",
"Authorization": os.environ['GITHUB_TOKEN'],
"X-GitHub-Api-Version": "2022-11-28"
}
requests.post("https://api.github.com/markdown", headers=headers, json={"text": release.body})
Because GitHub supports all these HTML elements inside of its Markdown parser, you won't need to validate the source, and can run it on every release.
I don't know how well supported HTML list elements are in python libraries, but it may be best to use the GitHub API so that you will always know that you're supporting all the same features.