FIX: `uploads:migrate_to_s3` broken for GlobalSetting using file provider.

FIX: uploads:migrate_to_s3 broken for GlobalSetting using file provider.

diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index 1ca1d3e..5a88a62 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -228,7 +228,11 @@ def migrate_to_s3
     exit 1
   end
 
-  unless GlobalSetting.use_s3?
+  unless ENV["DISCOURSE_S3_SECRET_ACCESS_KEY"].present? &&
+    ENV["DISCOURSE_S3_REGION"].present? &&
+    ENV["DISCOURSE_S3_ACCESS_KEY_ID"].present? &&
+    ENV["DISCOURSE_S3_SECRET_ACCESS_KEY"].present?
+
     puts <<~TEXT
       Please provide the following environment variables
         - DISCOURSE_S3_BUCKET

GitHub sha: d8287689

This commit has been mentioned on Discourse Meta. There might be relevant details there: