Skip to content
37 changes: 20 additions & 17 deletions markdown-templates/step-feedback/step-results-table.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
{{#passed}}
{%- set all_passed = (results_table | selectattr("passed") | length) == (results_table | length) %}

{%- if all_passed %}

## Step {{ step_number }} - Passed ✅

{{/passed}}
{{^passed}}
{%- else %}

## Step {{ step_number }} - Fail ❌

{{/passed}}
{%- endif %}

{{#passed}}
{%- if all_passed %}
<img src="https://octodex.github.com/images/inflatocat.png" align="right" height="150px" alt="Inflatocat image indicating the step passed" />
{{/passed}}
{{^passed}}
{%- else %}

<img src="https://octodex.github.com/images/spidertocat.png" align="right" height="100px" alt="Spidertocat image indicating the step failed" />
Some checks failed. Please review the results below and try again.

Time to find the bug! 🤔
{{/passed}}
{%- endif %}

| Status | Description |
| --- | --- |
{{#results_table}}
| {{#passed}}✅ - Pass{{/passed}}{{^passed}}❌ - Fail{{/passed}} | {{ description }} |
{{/results_table}}
| ------ | ----------- |

{{#tips.length}}
{%- for row in results_table %}
| {% if row.passed -%}✅ - Pass{%- else -%}❌ - Fail{%- endif %} | {{ row.description }} |
{%- endfor %}

{%- if tips and tips.length %}

### Tips

{{#tips}}
{%- for tip in tips %}

- {{ tip }}
{%- endfor %}

- {{.}}
{{/tips}}
{{/tips.length}}
{%- endif %}