Commit e73c9ddc authored by Sean McGivern's avatar Sean McGivern

Extend changelog checker to test file extensions

Changelogs without a .yml extension won't be picked up, and will be ignored
completely, so fail the pipeline when one of those is found.
parent f984d35f
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
require 'yaml' require 'yaml'
invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog| invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog|
next true if changelog =~ /(archive\.md|unreleased(-ee)?)$/
next false unless changelog.end_with?('.yml')
begin begin
YAML.load_file(changelog) YAML.load_file(changelog)
rescue rescue
...@@ -10,7 +13,7 @@ invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog| ...@@ -10,7 +13,7 @@ invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog|
end end
if invalid_changelogs.any? if invalid_changelogs.any?
puts "Changelogs with invalid YAML found!\n" puts "Invalid changelogs found!\n"
puts invalid_changelogs.sort puts invalid_changelogs.sort
exit 1 exit 1
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment