From f4f2663d2a5ca6c4217169dba6b7f6f405b50dd0 Mon Sep 17 00:00:00 2001 From: joaquintomas2003 Date: Thu, 30 Jan 2025 19:08:36 -0300 Subject: [PATCH] upload scraper screenshots in case of failure --- .github/workflows/scraper.yml | 7 +++++++ lib/scraper/bedelias.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scraper.yml b/.github/workflows/scraper.yml index 098e7e13..3456a4be 100644 --- a/.github/workflows/scraper.yml +++ b/.github/workflows/scraper.yml @@ -49,3 +49,10 @@ jobs: else echo "There were no changes. Nothing to do." fi + - name: Upload screenshots + if: failure() + uses: actions/upload-artifact@v4 + with: + name: scraper_screenshot + path: ./tmp/capybara + retention-days: 5 diff --git a/lib/scraper/bedelias.rb b/lib/scraper/bedelias.rb index 07f73236..9c8c4c46 100644 --- a/lib/scraper/bedelias.rb +++ b/lib/scraper/bedelias.rb @@ -19,7 +19,7 @@ def scrape Capybara.configure do |config| config.default_driver = ENV["HEADLESS"] == "false" ? :selenium_chrome : :selenium_chrome_headless config.run_server = false - config.save_path = "tmp" + config.save_path = "tmp/capybara" config.threadsafe = true end