Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8288e44
Nix flake checks
Pentusha Apr 2, 2026
d7faa0e
Add playwright-mcp package
Pentusha Apr 2, 2026
25f159c
Remove dead code
Pentusha Apr 2, 2026
f15dd2a
docs: consolidate duplicate MCP config examples into single section w…
Pentusha Apr 2, 2026
80ea4a1
feat: add auto-update steps for playwright-mcp
Pentusha Apr 2, 2026
ce0a7b7
refactor: use pname variable and document workspace fix
Pentusha Apr 2, 2026
2efd288
playwright: 1.59.0 -> 1.59.1
Pentusha Apr 3, 2026
c6d8415
refactor: update playwright components (#1)
Pentusha Apr 3, 2026
3acbc2d
Bump actions/checkout from 4 to 6 (#2)
dependabot[bot] Apr 3, 2026
b16f478
feat: add nix flake update to auto-update workflow
Pentusha Apr 3, 2026
572ffce
fix: use generic PR title for auto-update workflow
Pentusha Apr 3, 2026
dac6ff2
fix: use date-based branch name and clean up stale branches
Pentusha Apr 3, 2026
a425446
fix: use body-file for PR creation and add flake inputs to summary
Pentusha Apr 3, 2026
c6efbd7
feat: update existing PR when auto-update runs multiple times per day
Pentusha Apr 3, 2026
b38c586
refactor: show only changed items in PR summary, dynamic flake inputs
Pentusha Apr 3, 2026
96e8bc4
Update to version 1.59.1 (#3)
github-actions[bot] Apr 3, 2026
d70f087
fix: use PAT token in auto-update workflow to trigger CI
Pentusha Apr 3, 2026
24031a4
refactor: remove dead code from update.sh
Pentusha Apr 3, 2026
9f57d00
refactor: use matrix strategy for CI jobs
Pentusha Apr 3, 2026
ebd5a39
Update to version 1.59.1
github-actions[bot] Apr 7, 2026
96182f1
Merge pull request #4 from Pentusha/auto-update/2026-04-07
github-actions[bot] Apr 7, 2026
d859957
refactor: improve commit message in auto-update workflow
Pentusha Apr 9, 2026
e91ada6
Auto-update dependencies 2026-04-11
github-actions[bot] Apr 11, 2026
7dc3142
Merge pull request #5 from Pentusha/auto-update/2026-04-11
github-actions[bot] Apr 11, 2026
da53b2b
Auto-update dependencies 2026-04-16
github-actions[bot] Apr 16, 2026
3b17e05
Merge pull request #6 from Pentusha/auto-update/2026-04-16
github-actions[bot] Apr 16, 2026
fda70c5
Auto-update dependencies 2026-04-21
github-actions[bot] Apr 21, 2026
192a20d
Merge pull request #7 from Pentusha/auto-update/2026-04-21
github-actions[bot] Apr 21, 2026
c6f89de
Auto-update dependencies 2026-04-25
github-actions[bot] Apr 25, 2026
521b32b
Merge pull request #8 from Pentusha/auto-update/2026-04-25
github-actions[bot] Apr 25, 2026
b31733e
Auto-update dependencies 2026-04-28
github-actions[bot] Apr 28, 2026
4e4372b
Fix playwright-mcp build for v0.0.71
Claude Apr 28, 2026
c889273
Merge pull request #9 from Pentusha/auto-update/2026-04-28
github-actions[bot] Apr 28, 2026
8dfc39f
Auto-update dependencies 2026-04-29
github-actions[bot] Apr 29, 2026
5425877
Merge pull request #10 from Pentusha/auto-update/2026-04-29
github-actions[bot] Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
170 changes: 108 additions & 62 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,124 @@ on:
schedule:
- cron: "0 0 * * *"
jobs:
check-for-updates:
check-and-create-pr:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.updated.outputs.updated }}
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix flake update
- run: ./update.sh
- id: updated
run: cat updated.txt >> "$GITHUB_OUTPUT"
- name: Check for changes
id: changes
run: |
if git diff --quiet flake.lock versions.json playwright-driver/browsers.json 2>/dev/null; then
echo "updated=false" >> "$GITHUB_OUTPUT"
else
echo "updated=true" >> "$GITHUB_OUTPUT"
fi
- name: Build PR summary
if: steps.changes.outputs.updated == 'true'
id: summary
run: |
old_driver=$(git show HEAD:versions.json | jq -r '.driver.version')
new_driver=$(jq -r '.driver.version' versions.json)
old_mcp=$(git show HEAD:versions.json | jq -r '.mcp.version')
new_mcp=$(jq -r '.mcp.version' versions.json)
old_lock=$(git show HEAD:flake.lock)
old_browsers=$(git show HEAD:playwright-driver/browsers.json)
new_browsers=$(cat playwright-driver/browsers.json)

check-linux:
if: needs.check-for-updates.outputs.updated == 'true'
needs: check-for-updates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: ./update.sh
- run: nix build .#playwright-driver
- run: nix flake check
body="## Summary"$'\n\n'

check-darwin:
if: needs.check-for-updates.outputs.updated == 'true'
needs: check-for-updates
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: ./update.sh
- run: nix build .#playwright-driver
- run: nix flake check
# Core packages section (only if something changed)
core_rows=""
if [ "$old_driver" != "$new_driver" ]; then
core_rows+="| Playwright driver | \`${old_driver}\` | \`${new_driver}\` |"$'\n'
fi
if [ "$old_mcp" != "$new_mcp" ]; then
core_rows+="| Playwright MCP | \`${old_mcp}\` | \`${new_mcp}\` |"$'\n'
fi
if [ -n "$core_rows" ]; then
body+="### Core packages"$'\n\n'
body+="| Package | Old | New |"$'\n'
body+="|---------|-----|-----|"$'\n'
body+="$core_rows"$'\n'
fi

push-updates:
needs: [check-for-updates, check-linux, check-darwin]
runs-on: ubuntu-latest
# Flake inputs section (dynamically read inputs from flake.lock)
flake_rows=""
for input in $(jq -r '.nodes.root.inputs | keys[]' flake.lock); do
old_rev=$(echo "$old_lock" | jq -r ".nodes[\"${input}\"].locked.rev // empty" | head -c 7)
new_rev=$(jq -r ".nodes[\"${input}\"].locked.rev // empty" flake.lock | head -c 7)
if [ "$old_rev" != "$new_rev" ]; then
flake_rows+="| ${input} | \`${old_rev}\` | \`${new_rev}\` |"$'\n'
fi
done
if [ -n "$flake_rows" ]; then
body+="### Flake inputs"$'\n\n'
body+="| Input | Old | New |"$'\n'
body+="|-------|-----|-----|"$'\n'
body+="$flake_rows"$'\n'
fi

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
# Browser versions section (only changed browsers)
browser_rows=""
for browser in chromium firefox webkit; do
old_ver=$(echo "$old_browsers" | jq -r ".browsers[\"${browser}\"].browserVersion // \"—\"")
new_ver=$(echo "$new_browsers" | jq -r ".browsers[\"${browser}\"].browserVersion // \"—\"")
if [ "$old_ver" != "$new_ver" ]; then
title=$(echo "$new_browsers" | jq -r ".browsers[\"${browser}\"].title // \"${browser}\"")
browser_rows+="| ${title} | \`${old_ver}\` | \`${new_ver}\` |"$'\n'
fi
done
if [ -n "$browser_rows" ]; then
body+="### Browser versions"$'\n\n'
body+="| Browser | Old | New |"$'\n'
body+="|---------|-----|-----|"$'\n'
body+="$browser_rows"$'\n'
fi

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: ./update.sh
- name: Set commit and tagging message
id: commit_message_step
# Release notes (only for changed packages)
notes=""
if [ "$old_driver" != "$new_driver" ]; then
notes+="- [Playwright v${new_driver}](https://github.com/microsoft/playwright/releases/tag/v${new_driver})"$'\n'
fi
if [ "$old_mcp" != "$new_mcp" ]; then
notes+="- [Playwright MCP v${new_mcp}](https://github.com/microsoft/playwright-mcp/releases/tag/v${new_mcp})"$'\n'
fi
if [ -n "$notes" ]; then
body+="### Release notes"$'\n\n'
body+="$notes"
fi

echo "$body" > /tmp/pr-body.md
- name: Create or update Pull Request
if: steps.changes.outputs.updated == 'true'
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
echo 'commit_message<<EOF' >> $GITHUB_OUTPUT
echo "Update to version $(cat version.txt)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo 'tagging_message<<EOF' >> $GITHUB_OUTPUT
cat version.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.commit_message_step.outputs.commit_message }}
tagging_message: ${{ steps.commit_message_step.outputs.tagging_message }}
branch="auto-update/$(date +%Y-%m-%d)"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add flake.lock versions.json playwright-driver/browsers.json
git commit -m "Auto-update dependencies $(date +%Y-%m-%d)" -m "$(cat /tmp/pr-body.md)"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
git push --force -u origin "$branch"
existing_pr=$(gh pr list --head "$branch" --json number --jq '.[0].number // empty')
if [ -n "$existing_pr" ]; then
gh pr edit "$existing_pr" \
--title "Auto-update dependencies $(date +%Y-%m-%d)" \
--body-file /tmp/pr-body.md
else
gh pr create \
--title "Auto-update dependencies $(date +%Y-%m-%d)" \
--label "auto-update" \
--body-file /tmp/pr-body.md
fi
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "CI"
on:
pull_request:
jobs:
check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix build .#playwright-driver
- run: nix flake check

automerge:
runs-on: ubuntu-latest
needs: [check]
permissions: write-all
if: contains(github.event.pull_request.labels.*.name, 'auto-update')
steps:
- name: automerge
uses: pascalgn/automerge-action@v0.16.4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: ""
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ nix develop github:pietdevries94/playwright-web-flake
which playwright && playwright --version && playwright open nixos.org
```

### Playwright MCP Server

Run the [Playwright MCP server](https://github.com/Microsoft/playwright-mcp) for use with AI assistants like Claude.
Comment thread
Pentusha marked this conversation as resolved.

```sh
nix shell github:pietdevries94/playwright-web-flake#playwright-mcp
```

#### Configuration

Add the following to your MCP configuration file:

```json
{
"mcpServers": {
"playwright": {
"command": "nix",
"args": ["shell", "github:pietdevries94/playwright-web-flake#playwright-mcp", "--command", "playwright-mcp", "--headless"]
}
}
}
```

**Configuration file locations:**

| Tool | Config File Path |
|------|------------------|
| Claude Desktop | `~/.config/claude/claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`) |
| Claude Code | `.mcp.json` (in project root) |

### In a flake

1. Create a flake.nix with the content shown below.
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 35 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,44 @@
pkgs = import nixpkgs {
inherit system;
};
versions = pkgs.lib.importJSON ./versions.json;
playwright-driver-pkg = pkgs.callPackage ./playwright-driver/driver.nix { inherit versions; };
playwright-mcp = pkgs.callPackage ./playwright-mcp/package.nix {
inherit (self.packages.${system}) playwright-driver;
inherit versions;
};
in
{
packages = {
playwright-test = (pkgs.callPackage ./playwright-driver/driver.nix { }).playwright-test;
playwright-driver = (pkgs.callPackage ./playwright-driver/driver.nix { }).playwright-core;
inherit playwright-mcp;
inherit (playwright-driver-pkg) playwright-test;
playwright-driver = playwright-driver-pkg.playwright-core;
};

checks = {
playwright-test =
pkgs.runCommand "check-playwright-test"
{
nativeBuildInputs = [ self.packages.${system}.playwright-test ];
}
''
playwright --version | grep "${self.packages.${system}.playwright-test.version}"
touch $out
'';
playwright-driver = pkgs.runCommand "check-playwright-driver" { } ''
test -d "${self.packages.${system}.playwright-driver.browsers}"
test $(ls "${self.packages.${system}.playwright-driver.browsers}" | wc -l) -gt 0
touch $out
'';
playwright-mcp =
pkgs.runCommand "check-playwright-mcp"
{
nativeBuildInputs = [ self.packages.${system}.playwright-mcp ];
}
''
playwright-mcp --help
touch $out
'';
};

devShells.default = pkgs.mkShell {
Expand Down
15 changes: 3 additions & 12 deletions playwright-driver/chromium-headless-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
libxkbcommon,
nspr,
nss,
hashes,
...
}:
let
Expand All @@ -35,12 +36,7 @@ let
}
.${system} or throwSystem;
stripRoot = false;
hash =
{
x86_64-linux = "sha256-kQCw0nQHHuUIfn8rGVcN7Ip6ZOk5c3Or+GG5RvSica4=";
aarch64-linux = "sha256-s2IIjSY5t9AtT05dUS0mp4fPlaixND9+Cg0+0S8Kkx8=";
}
.${system} or throwSystem;
hash = hashes.${system} or throwSystem;
};

nativeBuildInputs = [
Expand Down Expand Up @@ -77,12 +73,7 @@ let
}
.${system} or throwSystem;
stripRoot = false;
hash =
{
x86_64-darwin = "sha256-kzbLpzzMpBurQHyGaz561A0K46GzgWPP2JSQKRV6C+Y=";
aarch64-darwin = "sha256-67ekk37uq5ITq9ZvwPTZhhqEgQY17g/3KJ/vnqZz3h0=";
}
.${system} or throwSystem;
hash = hashes.${system} or throwSystem;
};
in
{
Expand Down
Loading