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.
This commit is contained in:
parent
f984d35f1c
commit
e73c9ddc9e
1 changed files with 5 additions and 2 deletions
|
@ -2,7 +2,10 @@
|
|||
|
||||
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
|
||||
YAML.load_file(changelog)
|
||||
rescue
|
||||
|
@ -10,7 +13,7 @@ invalid_changelogs = Dir['changelogs/**/*.yml'].reject do |changelog|
|
|||
end
|
||||
|
||||
if invalid_changelogs.any?
|
||||
puts "Changelogs with invalid YAML found!\n"
|
||||
puts "Invalid changelogs found!\n"
|
||||
puts invalid_changelogs.sort
|
||||
exit 1
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue