Skip to content

feat(yaml): support YAML issue form templates#39

Merged
barrettruth merged 2 commits intomainfrom
feat/yaml-templates
Apr 4, 2026
Merged

feat(yaml): support YAML issue form templates#39
barrettruth merged 2 commits intomainfrom
feat/yaml-templates

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

Problem

discover_template only scanned .md files. GitHub and Forgejo/Gitea use .yml/.yaml issue form templates that were not picked up, so :Forge issue create missed them in repos that use YAML-based issue forms (including this one).

Solution

Add lua/forge/yaml.lua with a minimal YAML parser scoped to the issue template schema and a renderer that converts parsed body fields to markdown sections. Update discover_template to scan .yml/.yaml (skipping config.yml/config.yaml), return forge.TemplateResult (body, title?, labels?), pre-fill title and labels in the compose buffer, and show the template name field in the picker for YAML templates.

@barrettruth barrettruth force-pushed the feat/yaml-templates branch 2 times, most recently from b5e5067 to 8ce1d27 Compare April 4, 2026 00:10
Problem: `discover_template` only scanned `.md` files. GitHub and
Forgejo/Gitea use `.yml`/`.yaml` issue form templates that were not
picked up, so `:Forge issue create` missed them entirely.

Solution: add `lua/forge/yaml.lua` with a minimal YAML parser scoped
to the issue template schema and a renderer that converts parsed
fields to markdown. Update `discover_template` to scan `.yml`/`.yaml`
files (skipping `config.yml`/`config.yaml`), parse them via the new
module, and return a `forge.TemplateResult` with `body`, `title`, and
`labels`. Pre-fill title and labels in the compose buffer from YAML
template metadata. Show template `name` field in the picker instead
of filenames for YAML templates.
@barrettruth barrettruth force-pushed the feat/yaml-templates branch from 8ce1d27 to 79d1585 Compare April 4, 2026 00:14
Problem: submitting a compose buffer with the template body unmodified
would send placeholder content (e.g. `## Problem` / `## Solution`)
verbatim to the forge.

Solution: compare the body against the original template using
whitespace-normalized comparison. If unchanged, abort with a warning
and close the buffer. Applies to both issue and PR compose buffers.
@barrettruth barrettruth merged commit 790fc97 into main Apr 4, 2026
7 checks passed
@barrettruth barrettruth deleted the feat/yaml-templates branch April 4, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant