try using remote selenium
change
commit a11e521db0962ceeff8c399641f993d98c59a3e1
author Alpha Chen <alpha@kejadlen.dev>
date
parent 1448cb69
diff --git a/.github/workflows/pinboard.yml b/.github/workflows/pinboard.yml
index 092c885..af3366a 100644
--- a/.github/workflows/pinboard.yml
+++ b/.github/workflows/pinboard.yml
@@ -4,11 +4,17 @@ on:
   # schedule:
   #   - cron: "0 0 * * *"
   workflow_dispatch:
-    
+
 jobs:
   refresh-pinboard-errors:
     runs-on: ubuntu-latest
 
+    services:
+      selenium:
+        image: selenium/standalone-firefox
+        ports:
+          - 4444:4444
+
     steps:
       - uses: ruby/setup-ruby@v1
         with:
@@ -19,3 +25,5 @@ jobs:
         env:
           PINBOARD_USERNAME: ${{ secrets.PINBOARD_USERNAME }}
           PINBOARD_PASSWORD: ${{ secrets.PINBOARD_PASSWORD }}
+          REMOTE_SELENIUM_HOST: selenium
+
diff --git a/pinboard/refresh-pinboard-errors.rb b/pinboard/refresh-pinboard-errors.rb
index d64c174..ac2047c 100755
--- a/pinboard/refresh-pinboard-errors.rb
+++ b/pinboard/refresh-pinboard-errors.rb
@@ -17,10 +17,18 @@ def suppress_warnings
 end
 
 require "capybara"
-Capybara.default_driver = :selenium
-
 require "selenium/webdriver"
-Selenium::WebDriver::Firefox::Binary.path = "/Applications/Firefox\ Developer\ Edition.app/Contents/MacOS/firefox"
+
+remote_host = ENV.fetch("REMOTE_SELENIUM_HOST", "localhost:4444")
+Capybara.register_driver :remote do |app|
+  Capybara::Selenium::Driver.new(
+    app,
+    browser: :remote,
+    url: "http://localhost:4444/wd/hub",
+    desired_capabilities: :firefox,
+  )
+end
+Capybara.default_driver = :remote
 
 require "capybara/dsl"
 suppress_warnings do