The line below line sets a custom template tag for the current draft to be a string of comma space separated entries, where the entries are the tags of the current draft, prefixed with a hash symbol.
draft.setTemplateTag("taglist", draft.tags.map(strTag => "#" + strTag).join(", "));
You can then just reference it in the export action following a script action, like this:
In the action above I’ve set it to use the
safe_title template tag for the file name, with a Markdown file extension.
Presumably you have come custom code to set up your use of the
file template tag as that is not listed as a standard template tag. Which means you should just be able to add the line of code above to your own script action step.
Hope that helps.