|
60 | 60 |
|
61 | 61 | ## Example |
62 | 62 |
|
63 | | -Given an [example issue template](./__fixtures__/example/template.yml) and the |
64 | | -following issue submitted with that template: |
| 63 | +Given an |
| 64 | +[example issue template](./__fixtures__/example/.github/ISSUE_TEMPLATE/template.yml) |
| 65 | +and the following issue submitted with that template: |
65 | 66 |
|
66 | 67 | ```markdown |
67 | 68 | ### The Name of the Thing |
@@ -132,31 +133,67 @@ IssueOps-Demo-Writers-NotATeam |
132 | 133 |
|
133 | 134 | The output of this action would be: |
134 | 135 |
|
| 136 | +<!-- markdownlint-disable --> |
| 137 | + |
135 | 138 | ```json |
136 | 139 | { |
137 | | - "the_name_of_the_thing": "this-thing", |
138 | | - "the_nickname_of_the_thing": "thing", |
139 | | - "the_color_of_the_thing": ["blue"], |
140 | | - "the_shape_of_the_thing": ["square"], |
141 | | - "the_sounds_of_the_thing": ["re", "mi"], |
142 | | - "the_topics_about_the_thing": [], |
143 | | - "the_description_of_the_thing": "This is a description.\n\nIt has lines.", |
144 | | - "the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes", |
145 | | - "the_code_of_the_thing": "const thing = new Thing()\n\nthing.doThing()", |
146 | | - "the_string_method_of_the_code_of_the_thing": "thing.toString()", |
147 | | - "is_the_thing_a_thing": { |
| 140 | + "name": "this-thing", |
| 141 | + "nickname": "thing", |
| 142 | + "color": ["blue"], |
| 143 | + "shape": ["square"], |
| 144 | + "sounds": ["re", "mi"], |
| 145 | + "topics": [], |
| 146 | + "description": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!", |
| 147 | + "notes": "- Note\n- Another note\n- Lots of notes", |
| 148 | + "code": "const thing = new Thing()\nthing.doThing()", |
| 149 | + "code-string": "thing.toString()", |
| 150 | + "is-thing": { |
148 | 151 | "selected": ["Yes"], |
149 | 152 | "unselected": ["No"] |
150 | 153 | }, |
151 | | - "is_the_thing_useful": { |
| 154 | + "is-thing-useful": { |
152 | 155 | "selected": ["Sometimes"], |
153 | 156 | "unselected": ["Yes", "No"] |
154 | 157 | }, |
| 158 | + "read-team": "IssueOps-Demo-Readers", |
| 159 | + "write-team": "IssueOps-Demo-Writers" |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +<!-- markdownlint-enable --> |
| 164 | + |
| 165 | +### No Template Provided |
| 166 | + |
| 167 | +The `issue-form-template` input is optional. If not provided, the action will |
| 168 | +still parse the issue body, however the output will be a flat JSON object. The |
| 169 | +object keys will be slugified versions of the headers, and the values will be |
| 170 | +the contents of the headers. |
| 171 | + |
| 172 | +Using the same example as above, the output would instead be: |
| 173 | + |
| 174 | +<!-- markdownlint-disable --> |
| 175 | + |
| 176 | +```json |
| 177 | +{ |
| 178 | + "the_name_of_the_thing": "this-thing", |
| 179 | + "the_nickname_of_the_thing": "thing", |
| 180 | + "the_color_of_the_thing": "blue", |
| 181 | + "the_shape_of_the_thing": "square", |
| 182 | + "the_sounds_of_the_thing": "re, mi", |
| 183 | + "the_topics_about_the_thing": "_No response_", |
| 184 | + "the_description_of_the_thing": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!", |
| 185 | + "the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes", |
| 186 | + "the_code_of_the_thing": "const thing = new Thing()\nthing.doThing()", |
| 187 | + "the_string_method_of_the_code_of_the_thing": "thing.toString()", |
| 188 | + "is_the_thing_a_thing": "- [x] Yes\n- [ ] No", |
| 189 | + "is_the_thing_useful": "- [ ] Yes\n- [x] Sometimes\n- [ ] No", |
155 | 190 | "read_team": "IssueOps-Demo-Readers", |
156 | 191 | "write_team": "IssueOps-Demo-Writers" |
157 | 192 | } |
158 | 193 | ``` |
159 | 194 |
|
| 195 | +<!-- markdownlint-enable --> |
| 196 | + |
160 | 197 | ## Transformations |
161 | 198 |
|
162 | 199 | ### Headings |
|
0 commit comments