Files
osmedeus/test/testdata/workflows/test-example-report.yaml

148 lines
3.6 KiB
YAML

name: test-example-report
kind: module
description: Test example report with nested parallel steps with mixed types
tags: test,parallel,nested
params:
- name: target
required: true
reports:
- name: main-output
path: "{{Output}}/sub1.txt"
type: text
description: Main output file from the workflow
- name: http-json
path: "{{Output}}/http.json"
type: json
description: Structured JSON output
- name: markdown-report-report
path: "{{Output}}/reports/sample-markdown-report.md"
type: markdown
description: Markdown report output
steps:
- name: setup
type: bash
commands:
- mkdir -p {{Output}}/templates/
- 'echo "sub 1: {{target}}" > {{Output}}/sub1.txt'
- 'echo "sub 2: {{target}}" > {{Output}}/sub2.txt'
# Generate a summary report with just high-severity findings
- name: create-sample-repo-template
type: bash
command: |
cat > {{Output}}/templates/sample-markdown-report.md << 'EOF'
# Sample Repository Findings - {{Workspace}}
**Target**: {{Target}}
**Date**: {{TaskDate}}
```markdown
| ID | Name | Score |
| --- | --- | --- |
| 1 | Alice | 90 |
| 2 | Bob | 85 |
| 3 | Charlie | 88 |
```
---
*Report generated by Osmedeus {{Version}}*
EOF
- name: generate-sample-markdown-report
type: function
function: 'render_markdown_report("{{Output}}/templates/sample-markdown-report.md", "{{Output}}/reports/sample-markdown-report.md")'
# Generate a summary report with just high-severity findings
- name: create-sample-repo-template
type: bash
command: |
cat > {{Output}}/reports/sample-markdown-report.html << 'EOF'
<!DOCTYPE html>
<html>
<body>
<style>
table {
border-collapse: collapse;
width: 50%;
}
th, td {
border: 1px solid #333;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
pre {
background-color: #eee;
padding: 10px;
}
</style>
<h1>Sample Image with JavaScript</h1>
<h2>Example of &lt;pre&gt; Tag</h2>
<pre>
Name: Roman
Course: Web Development
Code Sample:
function hello() {
console.log("Hello, world!");
}
</pre>
<h2>Example of &lt;table&gt; Tag</h2>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Score</th>
</tr>
<tr>
<td>1</td>
<td>Alice</td>
<td>90</td>
</tr>
<tr>
<td>2</td>
<td>Bob</td>
<td>85</td>
</tr>
<tr>
<td>3</td>
<td>Charlie</td>
<td>88</td>
</tr>
</table>
<p id="message">Click the image 👆</p>
<img src="https://via.placeholder.com/150" id="img">
<script>
document.getElementById("img").onclick = () => alert("Image clicked!");
</script>
</body>
</html>
EOF
- name: store-html-report
type: function
function: 'store_artifact("{{Output}}/reports/sample-markdown-report.html", "html")'
- name: generate-http-json
type: bash
command: curl -s http://httpbin.org/get > {{Output}}/http.json