Skip to content

GitHub Step Summary

Writes Markdown into the $GITHUB_STEP_SUMMARY file, optionally clearing previous content first.

Inputs

Input Required Default Description
title Optional heading rendered as an H2 before the markdown body; omitted when left blank.
markdown Body text appended to the step summary exactly as provided.
overwrite false Set to 'true' to truncate $GITHUB_STEP_SUMMARY before writing; defaults to 'false' so content is appended.

Usage

Render cog validation results in the workflow summary (.github/workflows/check-pr.yml):

test-step-summary:
  name: Test Step Summary
  uses: ./.github/workflows/step-summary.yml
  needs: [run-integration-tests]
  if: always()
  with:
    title: "Integration Test Results"
    markdown: |
      ${{ needs.run-integration-tests.outputs.failed_tests == '0' && '✅ All tests passed!' || '❌ Some tests failed' }}

      | Metric | Value |
      |--------|-------|
      | **Total Tests** | ${{ needs.run-integration-tests.outputs.total_tests }} |
      | **Passed Tests** | ✅ ${{ needs.run-integration-tests.outputs.passed_tests }} |
      | **Failed Tests** | ${{ needs.run-integration-tests.outputs.failed_tests == '0' && '✅' || '❌' }} ${{ needs.run-integration-tests.outputs.failed_tests }} |
      | **Total Duration** | ${{ needs.run-integration-tests.outputs.total_duration }}s |
      | **Average Duration** | ${{ needs.run-integration-tests.outputs.average_duration }}s |

      ---

      **Test Status**: ${{ needs.run-integration-tests.result == 'success' && '✅ Completed Successfully' || '⚠️ Completed with Issues' }}
    overwrite: false