diff options
Diffstat (limited to 'danger/govendor_proto_check/Dangerfile')
-rw-r--r-- | danger/govendor_proto_check/Dangerfile | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/danger/govendor_proto_check/Dangerfile b/danger/govendor_proto_check/Dangerfile new file mode 100644 index 000000000..9f186fc4b --- /dev/null +++ b/danger/govendor_proto_check/Dangerfile @@ -0,0 +1,15 @@ +require 'json' + +VENDOR_JSON = 'vendor/vendor.json' + +if git.modified_files.include?(VENDOR_JSON) + parsed_json = JSON.parse(File.read(VENDOR_JSON)) + + proto = parsed_json["package"]&.find { |h| h["path"].start_with?("gitlab.com/gitlab-org/gitaly-proto") } + + unless proto["version"] && proto["version"] =~ /\Av\d+\./ + fail("gitaly-proto version is incorrect") + end +end + +# vim: ft=ruby |