Preview Dash0 Dashboards

Composite GitHub Action that previews the dashboards of a pull request as ephemeral dashboards in Dash0 and comments the preview links on the pull request.

Preview the Dash0 dashboards of a pull request before you merge it. For each Dashboard and PersesDashboard in a file or directory, this action creates or updates an ephemeral dashboard in Dash0, and comments the preview links on the pull request. Dash0 deletes each preview once its ttl has passed since the latest run of the action.

This action wraps the experimental dash0 dashboards preview  command. It is standalone: it installs the Dash0 CLI automatically if it is not already on PATH. If the setup action has already run, the existing installation and profile are reused.

Quick start

on:
  pull_request:
    paths:
      - 'dashboards/**'

permissions:
  contents: read
  pull-requests: write

concurrency: preview-dashboards-${{ github.event.pull_request.number }}

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Preview Dash0 dashboards
        uses: dash0hq/dash0-cli/.github/actions/preview-dashboards@main
        with:
          api-url: ${{ vars.DASH0_API_URL }}
          auth-token: ${{ secrets.DASH0_AUTH_TOKEN }}
          path: dashboards/

You can use any git ref: @main, @v1.25.0, or @<commit-sha>. The pull-requests: write permission lets the action comment on the pull request. The concurrency group keeps two quick pushes from posting two comments.

The pull request comment

The action posts one comment with a table of the previews:

DashboardStatusPreviewCurrent
OrdersNEWOpen -
CheckoutUPDATEDOpen Open 

NEW means the dashboard does not exist in Dash0 yet, and UPDATED means it does, so the Current column links to it. If the CLI cannot list the dashboards in Dash0, it prints a warning, and every row shows NEW. On every later run, the action updates the same comment instead of posting a new one. Runs with a different path, dataset, or prefix keep one comment each. When the pull request removes the last dashboard under path, the comment says there are no dashboards to preview. The comment shows no diff, because the pull request already shows the change to the dashboard files.

Pull requests from forks

GitHub does not pass secrets to a workflow that runs on a pull request from a fork. Without an auth token, the action skips the previews with a warning instead of failing the job. On any other event, a missing auth token fails the job.

Warning

The action skips fork pull requests on purpose. Do not switch to pull_request_target to get previews for them. That event passes your secrets to the job, so it writes the fork's YAML to your Dash0 organization with your token, and any step that runs code from the fork can read the token. If you need it anyway, require approval in a deployment environment  and review the pull request before you approve each run.

Inputs

CLI installation

InputRequiredDefaultDescription
cli-versionNolatestDash0 CLI version to install (e.g., 1.25.0). Minimum supported: 1.23.0, which introduced dashboards preview. Ignored if the CLI is already on PATH.

Connection

InputRequiredDefaultDescription
api-urlRecommendedDash0 API URL. Overrides the active CLI profile. Find yours under Endpoints .
auth-tokenRecommendedDash0 auth token. Overrides the active CLI profile. Store it in a GitHub secret .
datasetNodefaultDash0 dataset name. Overrides the active CLI profile.

If the setup action already configured a profile with these values, you do not need to specify them again.

Preview

InputRequiredDefaultDescription
pathYesPath to a file or directory containing dashboard definitions (mirrors dashboards preview -f). Documents of other kinds are skipped.
ttlNo1dHow long each preview lives after its latest write, as a duration such as 12h or 7d.
prefixNopr-<number>Prefix for the name of each preview. It also keeps the previews of different prefixes apart, so the previews of one pull request do not replace those of another. Outside a pull request, the default is no prefix.
commentNotrueComment the preview links on the pull request. Has no effect outside a pull request.

Outputs

OutputDescription
previewsJSON array of previews, each {"name", "id", "action", "url", "current"}, as printed by dash0 dashboards preview -o json. current is present only when the dashboard exists in Dash0. Empty when the action skipped.
preview-countNumber of previews created or updated. Empty when the action skipped.

Supported runners

  • ubuntu-latest (x64)
  • ubuntu-24.04-arm (arm64)

Last updated: