Class: Kamal::Lint::Formatters::Github
- Inherits:
-
Object
- Object
- Kamal::Lint::Formatters::Github
- Defined in:
- lib/kamal/lint/formatters/github.rb
Overview
GitHub Actions workflow command output. See: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
Constant Summary collapse
- LEVEL =
{ error: "error", warning: "warning", info: "notice" }.freeze
Instance Method Summary collapse
-
#initialize(io: $stdout) ⇒ Github
constructor
A new instance of Github.
- #render(result) ⇒ Object
Constructor Details
#initialize(io: $stdout) ⇒ Github
Returns a new instance of Github.
15 16 17 |
# File 'lib/kamal/lint/formatters/github.rb', line 15 def initialize(io: $stdout) @io = io end |
Instance Method Details
#render(result) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/kamal/lint/formatters/github.rb', line 19 def render(result) result.findings.each do |finding| level = LEVEL[finding.severity] || "notice" attrs = { file: finding.file, line: finding.line, col: finding.column, title: title_for(finding) }.compact attr_str = attrs.map { |k, v| "#{k}=#{escape_property(v.to_s)}" }.join(",") = (finding.) @io.puts "::#{level} #{attr_str}::#{}" end end |