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 to update the comment in place on every push.
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 progress
Compare pull request counts with the latest measurement stored for each initiative. Create the initiative in the dashboard first. Send the counts from the branch. Dev Herald writes the change and posts the comment.
The comparison uses the last measurement you posted, not the commits merged since then. Post a new measurement on every push to the default branch when you want that delta to match current main. A weekly schedule keeps comparing pull requests to the same snapshot until the next 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
- Learn about Sticky Comments to update comments in place
- Browse use cases for end-to-end workflow examples