Naturalclar / issue-action

github action for github issue
MIT License
60 stars 20 forks source link

bug/question: define multiline json string for `parameters` #256

Closed Hotell closed 2 years ago

Hotell commented 2 years ago

Hi, I'm struggling to define parameters on multiple lines.

Why multiple lines? as our project is quite big we need lot of rules, which if defined inline became hard to read/maintain/bad DX

None of these works:

parameters: >
            '[
              {"keywords": ["projectA"], "labels": ["A"]},
              {"keywords": ["projectB"], "labels": ["B"]},
              {"keywords": ["projectC"], "labels": ["C"]}
            ]'
parameters: >
            '`[
              {"keywords": ["projectA"], "labels": ["A"]},
              {"keywords": ["projectB"], "labels": ["B"]},
              {"keywords": ["projectC"], "labels": ["C"]}
            ]`'

both will trigger JSON parse error

image

Do you have any suggestion how to achieve that ?

Thank you!

Hotell commented 2 years ago

this does the job

parameters: '[
              {"keywords": ["projectA"], "labels": ["A"]},
              {"keywords": ["projectB"], "labels": ["B"]},
              {"keywords": ["projectC"], "labels": ["C"]}
            ]'