feat(templates): add custom template files and CLI preview #202
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/ttheart!202
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/add-custom-templates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add custom template support:
Action.template_file— per-action external template file (#154)InterpolateFile()— loads and renders templates from files (#155)-test-templateCLI flag — preview template rendering (#156)-test-payloadflag — JSON payload context for preview (#156)Interpolateinto sharedrender()with extractedtemplateFuncs()Why
Enables reusable template files instead of inline YAML strings. CLI preview lets operators test templates without triggering webhooks.
Testing
go test ./...and pre-commit passBreaking Changes
None.
template_fileis optional — defaults to inlinecommand.Notes
ttheart -test-template '{{ .action }}' -test-payload '{"action":"push"}'Closes #157
Closes #154
Closes #155
Closes #156
Review
Clean template refactoring with CLI preview. All tests pass, lint and vet clean.
Changes:
templateFuncs()extracted fromInterpolateinto shared functionrender()internal helper used by all template functionsInterpolateFile(path, payload)— loads and renders template from filePreview()— CLI-facing render functionAction.TemplateFile— optional, overrides inlineCommandInterpolateFilewhentemplate_fileis set-test-template+-test-payloadCLI flags for previewVerified:
./ttheart -test-template 'Hello {{ .name }}' -test-payload '{"name":"world"}'→Hello world✓No blocking issues.
APPROVED