summaryrefslogtreecommitdiff
path: root/scripts/lint-changelog-yaml
blob: 402a0c42bd3cc2588248591cbc0b60c67840b051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

require 'yaml'

invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog|
  begin
    YAML.load_file(changelog)
  rescue
  end
end

if invalid_changelogs.any?
  puts "Changelogs with invalid YAML found!\n"
  puts invalid_changelogs.sort
  exit 1
else
  puts "All changelogs are valid YAML.\n"
  exit 0
end