Skip to main content

Configuration Reference

Permissions​

permissions:
contents: read # Required for test-only jobs
pull-requests: write # PR comments (fork PRs may need a separate reporting job)
checks: write # Check runs and annotations

Job-level permissions apply to every step in that job. Use contents: write when the same job creates GitHub Releases or uploads release assets. See Workflow integration rules for release workflows, non-blocking reporting, and fork PR patterns.

Inputs​

Test Results​

test-results​

Glob pattern for test result files.

  • Default: **/*.{trx,xml}

Code coverage​

Conceptually grouped as:

coverage:
enabled: true
files:
- "**/coverage.cobertura.xml"
fail-if-missing: false

GitHub Actions inputs are flat strings:

coverage-enabled​

Enable code coverage collection and reporting (PR comment, job summary, HTML report, history repository sidecar, dashboard).

  • Default: false

coverage-files​

Glob pattern(s) for coverage files. Use comma-separated patterns for multiple globs.

  • Default: **/coverage.cobertura.xml
  • Supported formats: Cobertura (including Coverlet output), OpenCover, LCOV, JaCoCo

coverage-fail-if-missing​

Fail the step when coverage is enabled but no files match or all parses fail.

  • Default: false

Build diagnostics​

diagnostics-enabled​

Enable build diagnostic (compiler warning/error) collection. When history-enabled is true, compact summaries and a per-run .diagnostics.json sidecar are published to the history repository for the dashboard Build Insights tab.

  • Default: false

diagnostics-files​

Glob pattern(s) for build diagnostic files (SARIF, MSBuild logs, gcc/clang logs). Use comma-separated patterns for multiple globs.

  • Default: **/*.{sarif,log}
  • Supported formats: SARIF 2.1, MSBuild/Roslyn console output, gcc/clang compiler output

diagnostics-fail-if-missing​

Fail the step when diagnostics are enabled but no files match or all parses fail.

  • Default: false

See Build diagnostics for workflow examples.

Workflow timing​

workflow-timing-enabled​

Fetch workflow job and step durations from the GitHub Actions API when publishing to the history repository. Requires actions: read on GITHUB_TOKEN (included in default permissions for same-repo workflows).

  • Default: true
  • Only runs when history-enabled is true

Reporting​

reports-subdirectory​

Subdirectory within the site artifact for test reports.

  • Default: test-reports

report-title​

Title displayed in report UI and GitHub outputs.

  • Default: Actions Insights

report-output​

Local directory for the current run's report files.

  • Default: _report

site-output​

Local directory for the merged site with history.

  • Default: _site

PR Comment​

comment-mode​

PR comment behavior.

  • Default: update
  • Values: update (upsert single comment), off

max-failed-tests-in-comment​

Maximum failed tests shown in the PR comment.

  • Default: 10

max-stack-trace-lines​

Maximum stack trace lines before truncation.

  • Default: 25

include-stdout / include-stderr​

Include stdout/stderr in failure details.

  • Default: true

Job Summary​

generate-job-summary​

Write a GitHub Actions job summary.

  • Default: true

max-failed-tests-in-summary​

Maximum failed tests in the job summary table.

  • Default: 20

Checks​

publish-checks​

Publish a GitHub check run.

  • Default: true

check-name​

Name of the check run.

  • Default: Actions Insights

Artifact​

upload-html-report​

Upload the HTML report site as a workflow artifact.

  • Default: true

artifact-retention-days​

Retention days for the uploaded artifact.

  • Default: 30

include-raw-test-results​

Copy original test result files into the workflow artifact under raw/.

  • Default: true
  • Includes all files matching test-results, even if Actions Insights cannot parse them (for example JSON reporters).
  • Disable to upload only report.html and trends.json.

History​

history​

Maximum historical runs retained per branch/PR.

  • Default: 20

retain-days​

Maximum age in days for historical runs.

  • Default: 30

Display​

theme​

Report theme: light, dark, or auto.

  • Default: auto

slow-test-threshold-ms​

Duration threshold for marking tests as slow.

  • Default: 1000

include-slowest-tests​

Number of slowest tests to include (0 to disable).

  • Default: 18

Authentication​

github-token​

Token for GitHub API calls.

  • Default: ${{ github.token }}

Outputs​

OutputDescription
workflow-urlURL to the workflow run
artifact-urlDirect URL to the unzipped HTML report artifact (falls back to the workflow Artifacts section)
statuspassed or failed
totalTotal test count
passedPassed count
failedFailed count
skippedSkipped count

History Repository (optional)​

Publish structured JSON to a persistent history repository for the GitHub Pages dashboard. See History Repository Configuration for full details.

InputDefaultDescription
history-enabledfalseEnable JSON publishing
history-repository''History repo (owner/repo)
history-token''Token with write access (required when enabled)
history-branchmainTarget branch
history-pathdataData root path
history-repository-nameautoSource repo key
history-modemultiReserved
history-default-repository''Default dashboard repository
history-pages-url''Base URL for the history dashboard (GitHub Pages). If unset, Actions Insights will try to discover it or fall back to https://{owner}.github.io/{repo}/.

On pull_request workflows, guard history-enabled so fork PRs do not attempt to publish — fork PRs cannot access repository secrets. See History Repository Configuration.

Example​

- uses: mzbrau/actions-insights@v1
with:
test-results: '**/*.trx'
comment-mode: update
max-failed-tests-in-comment: 10
max-stack-trace-lines: 25
include-slowest-tests: 18
upload-html-report: true
publish-checks: true