gitlab-ce/tooling/bin/find_only_allowed_files_cha...

15 lines
432 B
Ruby
Executable File

#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../lib/tooling/find_changes'
ALLOWED_FILE_TYPES = ['.js', '.vue', '.md', '.scss'].freeze
if Tooling::FindChanges.new(from: :api).only_allowed_files_changed
puts "Only files with extensions #{ALLOWED_FILE_TYPES.join(', ')} were changed"
exit 0
else
puts "Changes were made to files with extensions other than #{ALLOWED_FILE_TYPES.join(', ')}"
exit 1
end