Skip to Content
PR CommentsTemplates

Templates

Dev Herald provides pre-built comment templates for common automated signals in your CI pipeline. Templates handle formatting and structure — you pass in the data.

Use templates with the template and template-data inputs on the dev-herald/comment action. Add a sticky-id so the comment updates in place and can be removed when a later run has nothing to report.

The examples below already include a sticky-id. Keep those ids stable across runs. How to delete a stale comment is covered in Sticky Comments.

Available templates

Deployment Status

Surface deployment information directly in PRs — preview URLs, deployment status, and build artifacts.

- name: Post Deployment Status uses: dev-herald/comment@v1 with: api-key: ${{ secrets.DEV_HERALD_API_KEY }} pr-number: ${{ github.event.pull_request.number }} template: DEPLOYMENT sticky-id: deployment-status template-data: | { "projectName": "My App", "deploymentStatus": "Ready", "previewLink": "https://preview-pr-123.myapp.com", "deploymentLink": "https://vercel.com/deployments/abc123", "showTimestamp": true }

Required fields: projectName, deploymentStatus
Optional fields: projectLink, deploymentLink, previewLink, commentsLink, showTimestamp

See the Vercel Preview Comments guide for a full workflow example.

Initiative comparison

Compare the pull request’s current counts with the baseline snapshot. Create the initiative in the dashboard first. Post the baseline with dev-herald/health on the default branch — see Initiatives. This comment sends the branch’s current counts. Dev Herald writes the change against the latest snapshot.

The comparison uses that snapshot, which is the last measurement the health action posted. A weekly health schedule keeps pull requests compared to the same snapshot until the next health run.

- name: Post initiative progress uses: dev-herald/comment@v1 with: api-key: ${{ secrets.DEV_HERALD_API_KEY }} pr-number: ${{ github.event.pull_request.number }} template: INITIATIVE sticky-id: initiatives template-data: | { "initiatives": { "emotion-to-panda": { "files": 10, "usages": 80 } } }

Required fields: initiatives (slug-keyed counts for every metric on that initiative)

Custom Table

Create structured tables for any data — bundle sizes, coverage reports, performance metrics, and more. Each cell is markdown (GitHub-Flavored Markdown: links, bold, `code`, and more). Literal pipe characters in your markdown are automatically escaped so the table layout stays valid.

- name: Post Bundle Size Analysis uses: dev-herald/comment@v1 with: api-key: ${{ secrets.DEV_HERALD_API_KEY }} pr-number: ${{ github.event.pull_request.number }} template: CUSTOM_TABLE sticky-id: bundle-analysis template-data: | { "title": "Bundle Size Analysis", "headers": ["Package", "Size", "Change", "Status"], "rows": [ { "cells": [ { "markdown": "[main.js](https://example.com/chunk-main)" }, { "markdown": "245 KB" }, { "markdown": "-12 KB ⬇️" }, { "markdown": "✅ **Improved**" } ] }, { "cells": [ { "markdown": "vendor.js" }, { "markdown": "890 KB" }, { "markdown": "+5 KB ⬆️" }, { "markdown": "⚠️ Watch" } ] } ], "showTimestamp": true }

Required fields: headers, rows (at least one row with cells; each cell has markdown)
Optional fields: title, showTimestamp

See Bundle Change Comments for a workflow that computes and posts bundle diffs.

Template data validation

All templates use Zod schemas  for validation. If you provide invalid data, Dev Herald returns a detailed error message explaining what’s wrong.

Next steps

Last updated on