Save text with a certain file type in shortcuts

I have some text as part of a shortcut and I want to save it as a file (I’m on MacOS). Whenever I use the save file active it does it as a .txt file but I want it to be markdown. Is there a way to change this file extension? Maybe I can use AppleScript to change the file extension after saving it?

Thanks in advance for the help.

You can use the set name action to set the whole filename including the file extension.