feat(yaml): support YAML issue form templates#39
Merged
barrettruth merged 2 commits intomainfrom Apr 4, 2026
Merged
Conversation
b5e5067 to
8ce1d27
Compare
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.
8ce1d27 to
79d1585
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
discover_templateonly scanned.mdfiles. GitHub and Forgejo/Gitea use.yml/.yamlissue form templates that were not picked up, so:Forge issue createmissed them in repos that use YAML-based issue forms (including this one).Solution
Add
lua/forge/yaml.luawith a minimal YAML parser scoped to the issue template schema and a renderer that converts parsed body fields to markdown sections. Updatediscover_templateto scan.yml/.yaml(skippingconfig.yml/config.yaml), returnforge.TemplateResult(body,title?,labels?), pre-fill title and labels in the compose buffer, and show the templatenamefield in the picker for YAML templates.