Apple Shortcut is extremely powerful and flexible. At the same time, it can be extremely stupid.
For some reason there’s no easy way to save some text with a format that is not .txt.
I write everything in markdown (.md). Notes, posts, everything. I just wanted a simple shortcut to create new posts from a template. Turns out there’s no obvious way to save text as anything other than .txt
Today, thanks to this Reddit post, I finally understood how to solve this.
The solution requires chaining Set name and Save file actions in a specific way:

If you want to check it out, you can download the shortcut from here:
www.icloud.com
New Post in Markdown - Shortcut
A shortcut to create new markdown blog posts from a template