superlint/test/linters/jscpd/ruby_good_1.rb
Marco Ferrari e6cf8d3845
Move tests to the test directory (#4985)
* Move tests to the test directory

* Fix linting errors

* Add states back

* Add xml back
2023-12-15 08:50:35 +00:00

23 lines
920 B
Ruby

# frozen_string_literal: true
# Rails Console only
# This script will output all active webhooks currently being processed by an instance.
# Replace ARRAY_OF_URLS_CALLING_INSTANCE and GHES_URL with the appropriate values before running
# Prior to running this script, compile a list of the top URLs containing the phrase webhook
# This should be ran prior to entering the Rails Console with the command:
# grep -B1 --no-group-separator 'Faraday::TimeoutError' hookshot-logs/resqued.log | sed -n 1~2p |
# \ grep -v 'Faraday::TimeoutError: request timed out' | sort | uniq -c |sort -rn | head -n 20
File.open("/tmp/urls.txt", "w") do |file|
Hook.active.map do |h|
urls = [ARRAY_OF_URLS_CALLING_INSTANCE]
next if urls.include? h.url
begin
file.puts "https://GHES_URL/api/v3/repos/#{h.installation_target.full_name}/hooks/#{h.id}"
rescue StandardError => e
puts e.message
end
end
end