Overview

The TestDriver GitHub Action provides several output variables that can be used to create powerful workflows by chaining actions together. These outputs allow you to post results as comments, send notifications, or integrate with third-party test reporting tools.


Output variables

VariableDescription
summaryContains the TestDriver AI text summary result of the action execution.
linkA link to the Dashcam dashboard for debugging test runs.
markdownMarkdown-formatted shareable link, including a screenshot of the desktop.
successIndicates whether the action passed successfully (true or false).

Example: Creating a comment on a pull request

The following example demonstrates how to use the output variables to create a comment on a pull request after every TestDriver execution.

Workflow example

name: TestDriver

permissions:
  actions: read
  contents: read
  statuses: write
  pull-requests: write

on:
  pull_request:

jobs:
  test:
    name: "TestDriver"
    runs-on: ubuntu-latest
    id: run-testdriver
    steps:
      - uses: dashcamio/testdriver@main
        version: v4.0.0
        key: ${{ secrets.TD_API_KEY }}
        with:
          prompt: |
            1. /run /Users/ec2-user/actions-runner/_work/testdriver/testdriver/.testdriver/test.yaml
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FORCE_COLOR: "3"

  - name: Create comment on PR
    if: ${{ always() }}
    uses: peter-evans/create-or-update-comment@v3
    with:
      issue-number: ${{ github.event.pull_request.number }}
      body: |
        **Test Summary:**
        ${{ steps.run-testdriver.outputs.summary }}

        **Markdown Report:**
        ${{ steps.run-testdriver.outputs.markdown }}

        **Dashcam Link:**
        [View Test Results](${{ steps.run-testdriver.outputs.link }})

Use cases for output variables

1. Post test results as comments

Use the summary and markdown outputs to post detailed test results as comments on pull requests. This provides immediate feedback to developers.

2. Send notifications on failure

Use the success output to trigger notifications (for example, email or Slack) when a test fails.

Example:

- name: Notify on Failure
  if: ${{ steps.run-testdriver.outputs.success == 'false' }}
  run: |
    echo "Test failed! Sending notification..."
    # Add your notification logic here

3. Integrate with third-party tools

Use the link output to upload test results to third-party test reporting tools or dashboards.


Notes

  • The link output provides a direct URL to the Dashcam dashboard, making it easy to debug test runs.
  • The markdown output includes a screenshot of the desktop, which is useful for visualizing test results.
  • Always use the success output to handle conditional workflows based on test outcomes.