From 1cfffe62cf4e37962b7b3cac4be5adc72d4fb04a Mon Sep 17 00:00:00 2001 From: David Backeus Date: Wed, 5 Jul 2023 14:11:06 +0200 Subject: [PATCH] Use JSON.parse instead o JSON.load_file for Ruby 2.7 compatbility --- rubocop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop.rb b/rubocop.rb index 2ed6945..548a9a8 100644 --- a/rubocop.rb +++ b/rubocop.rb @@ -63,7 +63,7 @@ def self.request(request_class, path, params = nil) # Figure out which ruby files have changed and run Rubocop on them -github_event = JSON.load_file(ENV.fetch("GITHUB_EVENT_PATH")) +github_event = JSON.parse(File.read(ENV.fetch("GITHUB_EVENT_PATH"))) pr_number = github_event.fetch("pull_request").fetch("number") owner_and_repository = ENV.fetch("GITHUB_REPOSITORY")