Summary
I would like to propose support for repository-defined custom Handlebars helpers in validator comment templates.
Problem
issue-ops/validator already supports custom validation scripts, but comment templates are still limited to built-in helpers. Because of that, it is hard to format structured values in repository-specific ways.
For example, if an issue form contains a multiline textarea such as a list of team names, it may be more useful to render that value as a Markdown table in the success comment. That kind of formatting is difficult to do cleanly with only built-in helpers.
Proposal
Allow repositories to define custom Handlebars helpers in .github/validator/config.yml, alongside custom validators.
Example:
validators:
- field: github_username
script: username.js
helpers:
- name: linesToMarkdownTable
script: lines-to-markdown-table.js
The helper scripts would live in .github/validator/ and be loaded when rendering success.mustache and failure.mustache.
Example Use Case
There is a sample of the expected behavior in nmoa/issueops#8.
In that example, a multiline Teams to Add field is rendered as a Markdown table in the validator comment. That is the kind of output customization I would like to support in issue-ops/validator.
Why This Would Help
- It would let repositories keep validation logic and comment-formatting logic in the same place.
- It would make validator comments much more readable for structured inputs.
- It would avoid forcing repositories to fork the action just to customize comment output.
Compatibility and Safety
I think this can follow the same trust model as custom validators, since both features execute repository-defined scripts from the checked-out workspace.
To keep the behavior predictable, it would also make sense to:
- keep the feature optional
- prevent custom helpers from overriding built-in helper names
- preserve the current behavior when no helpers are configured
Thanks for considering this feature.
Summary
I would like to propose support for repository-defined custom Handlebars helpers in validator comment templates.
Problem
issue-ops/validatoralready supports custom validation scripts, but comment templates are still limited to built-in helpers. Because of that, it is hard to format structured values in repository-specific ways.For example, if an issue form contains a multiline textarea such as a list of team names, it may be more useful to render that value as a Markdown table in the success comment. That kind of formatting is difficult to do cleanly with only built-in helpers.
Proposal
Allow repositories to define custom Handlebars helpers in
.github/validator/config.yml, alongside custom validators.Example:
The helper scripts would live in
.github/validator/and be loaded when renderingsuccess.mustacheandfailure.mustache.Example Use Case
There is a sample of the expected behavior in nmoa/issueops#8.
In that example, a multiline
Teams to Addfield is rendered as a Markdown table in the validator comment. That is the kind of output customization I would like to support inissue-ops/validator.Why This Would Help
Compatibility and Safety
I think this can follow the same trust model as custom validators, since both features execute repository-defined scripts from the checked-out workspace.
To keep the behavior predictable, it would also make sense to:
Thanks for considering this feature.