JasonEtco / create-an-issue

A GitHub Action for creating a new issue from a template file.
MIT License
258 stars 83 forks source link

Parse JSON string passed via environment #152

Closed qlonik closed 1 year ago

qlonik commented 1 year ago

I couldn't find a way how to pass a JSON object (e.g. a list of things) to have them rendered using {% for item in items %} approach. So I added this simple function attempting to parse env variables starting with JSON_.

qlonik commented 1 year ago

Thank you for your response. No worries if it is out of scope of the project :smiley_cat: .

Could you elaborate on the other approach with parsing JSON in a separate action? I already have an action that creates a list of objects and encodes them as JSON (at the end of this file: https://github.com/qlonik/containers/blob/main/.github/workflows/upstream-schedule.yaml). I could potentially pass something else to this action, but I could not think of any other way of passing a list with variable length to this action.