Skip to content

Commit

Permalink
Match the Playwright version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Jan 7, 2025
1 parent c477118 commit 45c8d70
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/integration/
/integration-results/
/node_modules/
/scripts/
/src/.observablehq/
42 changes: 42 additions & 0 deletions .github/workflows/fix-playwright-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Fix Playwright versions

on:
push:
branches:
- 'dependabot/npm_and_yarn/playwright/test-*'

permissions:
contents: read

jobs:
fix-playwright-versions:
name: 'Fix Playwright versions'
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: 'Checkout code'
uses: actions/[email protected]
with:
token: ${{ secrets.PREREVIEW_BOT_TOKEN }}

- name: 'Set up Node.js'
uses: actions/[email protected]
with:
node-version-file: package.json
cache: ${{ !env.ACT && 'npm' || '' }}

- name: 'Install dependencies'
run: npm ci --ignore-scripts

- name: 'Fix Playwright versions'
run: scripts/fix-playwright-versions.sh

- name: 'Upload assets'
uses: stefanzweifel/[email protected]
if: ${{ !env.ACT }}
with:
commit_message: '[dependabot skip] Fix Playwright versions'
commit_user_name: 'prereview-bot'
commit_user_email: '[email protected]'
commit_author: 'prereview-bot <[email protected]>'
9 changes: 9 additions & 0 deletions scripts/fix-playwright-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e

version=$(npm list --depth=0 --json --package-lock-only | jq --raw-output '.dependencies."@playwright/test".version')

echo "Found @playwright/test $version"

echo "Updating CI"
sed --in-place --regexp-extended "s/mcr\.microsoft\.com\/playwright:v.+?-jammy/mcr.microsoft.com\/playwright:v$version-jammy/g" .github/workflows/ci.yml

0 comments on commit 45c8d70

Please sign in to comment.