A GitHub Action to set up ChromeDriver for automated testing
Features • Quick Start • Usage • Platform Support • Configuration • Examples • Contributing
- 🔧 Automatic Version Matching - Automatically installs ChromeDriver that matches your Chrome browser version
- 🖥️ Cross-Platform - Works on Ubuntu, macOS, and Windows
- ⚡ Fast Setup - Quick installation with minimal configuration
- 🎯 Version Control - Option to specify exact ChromeDriver version
- 🛠️ Custom Chrome Binary - Support for custom Chrome binary names
Add this step to your workflow to automatically set up ChromeDriver:
- uses: nanasess/setup-chromedriver@v3That's it! ChromeDriver will be installed and added to your PATH.
Note
Versioning — @v3 is the current major, a native TypeScript
reimplementation of the action. The public contract (inputs, install
locations, PATH behavior) is unchanged from @v2, so upgrading is a drop-in
replacement. @v2 remains available as the previous, shell-based
implementation for existing workflows that prefer to stay pinned.
Warning
@master is deprecated — the default branch is now main. If your
workflow references the action by the master branch
(uses: nanasess/setup-chromedriver@master), please migrate to @v3 (or pin
a full commit SHA). The master branch is frozen, emits a deprecation
warning at runtime, and will not receive future updates.
Tip
Supply-chain hardening — mutable tags like v3 can be repointed at any time, so for security-sensitive workflows pin the action to a full-length commit SHA instead. Keep the tag in a trailing comment for readability, and let Dependabot/Renovate bump the SHA for you:
# Pinned to a full commit SHA (recommended)
- uses: nanasess/setup-chromedriver@<full-commit-sha> # v3.0.0The simplest way to use this action is without any parameters. It will automatically detect your Chrome version and install the matching ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
- run: chromedriver --versionIf you need a specific version of ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
with:
chromedriver-version: '131.0.6778.87'
- run: chromedriver --versionIf your Chrome binary has a custom name:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
with:
chromeapp: chrome-betaWhen a job runs inside a container: image (e.g. ruby, elixir, node:slim,
debian:slim), the action sets up the Google Chrome apt repository and installs
Chrome for you. It downloads Google's signing key over HTTPS and registers it as
a signed-by keyring — the modern scheme that works on recent Debian releases
(12 "bookworm" and later), which removed the apt-key the action previously
relied on (see issues
#32 and
#243).
You only need to install a few base packages that minimal images do not ship:
- Install the prerequisites before
actions/checkout(checkout itself needsgit, which slim images do not ship):git sudo ca-certificates unzipgitforactions/checkout,unzipto extract ChromeDriver,ca-certificatesfor the HTTPS Chrome apt repository, andsudoonly when the container does not run as root.
- Pass
chromeapp: google-chrome-stable(the default on Linux) so the action'sdpkg -s <chromeapp>check and version detection use the package name, not thegoogle-chromebinary alias. The action installsgoogle-chrome-stableitself when it is not already present.
jobs:
test:
runs-on: ubuntu-latest
container:
image: ruby:3.2.2
steps:
# Prerequisites (must run before checkout, since checkout needs git)
- name: Install container prerequisites
run: |
apt-get update
apt-get install -y --no-install-recommends \
git sudo ca-certificates unzip
- uses: actions/checkout@v4
# The action registers the signed-by Chrome repo and installs Chrome and
# ChromeDriver. No manual Google Chrome setup is required.
- uses: nanasess/setup-chromedriver@v3
with:
chromeapp: google-chrome-stable
- run: chromedriver --version| Platform | Versions |
|---|---|
| Ubuntu | ubuntu-latest, ubuntu-24.04, ubuntu-22.04 |
| macOS | macos-latest, macos-15, macos-14 |
| Windows | windows-latest, windows-2025 , windows-2022 |
| Parameter | Description | Required | Default |
|---|---|---|---|
chromedriver-version |
The ChromeDriver version to install | No | Auto-detected |
chromeapp |
Custom Chrome binary name (Linux/macOS only) | No | System default |
name: UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
- name: Start ChromeDriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Run tests
run: npm testname: Windows UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
- name: Start ChromeDriver
run: chromedriver --url-base=/wd/hub &
- name: Run tests
run: npm testname: Cross-Platform Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v3
- name: Run tests
run: npm testname: Chrome Version Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: '131'
- uses: nanasess/setup-chromedriver@v3
with:
chromedriver-version: '131.0.6778.87'
- name: Run tests
run: npm testContributions are welcome! Here's how you can help:
- 🍴 Fork the repository
- 🔧 Create your feature branch (
git checkout -b feature/amazing-feature) - 💻 Make your changes
- ✅ Run tests with
pnpm test - 📝 Commit your changes (
git commit -m 'Add amazing feature') - 📤 Push to the branch (
git push origin feature/amazing-feature) - 🔄 Open a Pull Request
# Enable pnpm via Corepack (uses the version pinned in package.json)
corepack enable
# Install dependencies
pnpm install --frozen-lockfile
# Build the action
pnpm build
pnpm package
# Run tests
pnpm test
# Format code
pnpm formatFor more details on the architecture and development process, see CLAUDE.md.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who have helped improve this action
- Special thanks to the ChromeDriver team for their excellent work
If you find this action helpful, please consider:
- ⭐ Starring the repository
- 💬 Sharing it with others who might benefit
- 💰 Sponsoring the maintainer
Made with ❤️ by @nanasess