mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
Fixes the following error when generating the upcoming changes status report on a weekly basis in GitHub actions: ``` /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:56:in 'UpcomingChanges::StatusReport::Git#capture': git show 45535887f1231b40f8a21b8c154e58cef8670063:plugins/discourse-workflows/config/settings.yml failed: fatal: path 'plugins/discourse-workflows/config/settings.yml' exists on disk, but not in '45535887f1231b40f8a21b8c154e58cef8670063' (RuntimeError) from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:47:in 'UpcomingChanges::StatusReport::Git#show_file' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:227:in 'UpcomingChanges::StatusReport::GitHistory#statuses_at' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:215:in 'block in UpcomingChanges::StatusReport::GitHistory#add_history_for_settings_file' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:214:in 'Array#reverse_each' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:214:in 'UpcomingChanges::StatusReport::GitHistory#add_history_for_settings_file' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:205:in 'block in UpcomingChanges::StatusReport::GitHistory#by_change' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'Hash#each' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'Enumerable#each_with_object' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'UpcomingChanges::StatusReport::GitHistory#by_change' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:422:in 'UpcomingChanges::StatusReport#history_by_change' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:363:in 'block in UpcomingChanges::StatusReport#report' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'Hash#each' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'Enumerable#map' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'UpcomingChanges::StatusReport#report' from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:499:in 'UpcomingChanges::StatusReport::CLI.run' from /__w/discourse/discourse/script/upcoming_changes_status_report:9:in '<main>' ``` This happened because we were trying to run `git sho` on a file that was reverted in a commit. Now, we check whether the file exists for the specific commit hash before running git show, and continue with the next valid commit for the file.