← Back to Recipes

GitHub Actions test report

Render a chart in a workflow and attach it to a PR comment or job summary.

# .github/workflows/report.yml
- name: Render chart
  run: |
    curl -X POST ${{ secrets.CHART_OUTPUT_URL }}/api/v1/render \
      -H "Authorization: Bearer ${{ secrets.CHART_OUTPUT_API_KEY }}" \
      -H "Content-Type: application/json" \
      -d '{"type":"line","data":{"labels":["A","B","C"],"datasets":[{"data":[1,2,3]}]}}' \
      -o chart.png
- name: Upload chart
  uses: actions/upload-artifact@v4
  with:
    name: chart
    path: chart.png