- Quote the bug form's Version description (it did not parse, so GitHub offered no bug form at all). - .github/scripts/check-yaml.rb parses workflows, the compose file and the public issue forms (and checks the form shape); CI runs it on Linux and the release job runs it before publishing the forms. - Builds and publishes pass TitanoReleasesRepo=$RELEASES_REPO, so binaries read the repository they are published to. - Image links in the public repository point to the image the docker job pushed. - The public repository content follows the newest stable release; older tags and pre-releases only get their release, and an older stable tag is never marked Latest. - Screenshot captures time out after 10 minutes; the perf summary reports missing timings. - Public README names the in-app "Suggest a fix" link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
43 lines
1.7 KiB
Ruby
43 lines
1.7 KiB
Ruby
# Parses YAML files and checks the shape of GitHub issue forms, so a broken workflow, compose file or issue form fails
|
|
# CI instead of being skipped by GitHub (an issue form that does not parse is simply not offered).
|
|
# Usage: ruby .github/scripts/check-yaml.rb FILE...
|
|
require "yaml"
|
|
|
|
def issue_form_problem(doc)
|
|
return "the form is not a mapping" unless doc.is_a?(Hash)
|
|
return "the form needs a name and a description" unless doc["name"].is_a?(String) && doc["description"].is_a?(String)
|
|
return "the form needs a body list" unless doc["body"].is_a?(Array) && !doc["body"].empty?
|
|
|
|
ids = []
|
|
doc["body"].each_with_index do |item, i|
|
|
return "body item #{i + 1} has no type" unless item.is_a?(Hash) && item["type"].is_a?(String)
|
|
|
|
attributes = item["attributes"]
|
|
return "body item #{i + 1} has no attributes" unless attributes.is_a?(Hash)
|
|
|
|
if item["type"] == "markdown"
|
|
return "markdown item #{i + 1} has no value" unless attributes["value"].is_a?(String)
|
|
else
|
|
return "body item #{i + 1} has no label" unless attributes["label"].is_a?(String)
|
|
ids << item["id"] if item["id"]
|
|
end
|
|
end
|
|
return "duplicate ids #{ids.tally.select { |_, n| n > 1 }.keys.join(', ')}" if ids.uniq.size != ids.size
|
|
|
|
nil
|
|
end
|
|
|
|
failures = 0
|
|
ARGV.each do |path|
|
|
doc = YAML.safe_load(File.read(path), aliases: true, filename: path)
|
|
if File.basename(File.dirname(path)) == "ISSUE_TEMPLATE" && File.basename(path) != "config.yml"
|
|
problem = issue_form_problem(doc)
|
|
raise problem if problem
|
|
end
|
|
puts "ok #{path}"
|
|
rescue StandardError => e
|
|
puts "::error file=#{path},title=YAML::#{e.message.lines.first.to_s.strip}"
|
|
failures += 1
|
|
end
|
|
exit(failures.zero? ? 0 : 1)
|