Last active
July 29, 2020 20:26
-
-
Save testableapple/0a8471a49ab3437e697f27db4e4a190c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| impact_map = JSON.parse(File.read('impact_map.json')) | |
| response = JSON.parse(`curl -s -H "authorization: Bearer #{ENV['GITHUB_TOKEN']}" -X GET -G #{ENV['PULL_REQUEST']}/files`) | |
| impacted_files = response.map { |file| file['filename'] } | |
| impact_map.select! do |test, related_source_files| | |
| related_source_files.any? { |file| impacted_files.include?(file) } | |
| end | |
| puts impact_map.keys.join(',') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment