Skip to content

Get Playwright Version

Actions
Get the Playwright Version from the project lockfile
v1.2.0
Latest
Verified creator
Star (0)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

get-playwright-version

This parses the your project's lockfile and returns the installed playwright version. Supported are package-lock.json (NPM), yarn.lock (Yarn 1), and pnpm-lock.yaml (PNPM).

If you are using the Playwright Docker Image in your CI, Playwright strongly recommends using a versioned tag. This action can help you make sure your project's Playwright version matches the Playwright Docker Image version.

Release

Prerequisites

Define whatever your action needs to run here

Usage

name: Playwright Tests
on:
  push:
    branches: [ main ]

jobs:
  read-playwright-version:
    name: 'Read Playwright Version'
    runs-on: ubuntu-latest
    inputs:
      no-version-found: 'error'
    outputs:
      playwright-version: ${{ steps.get_playwright_version.outputs.playwright-version }}
    steps:
      - uses: actions/checkout@v4
      - id: get_playwright_version
				uses: eviden-actions/get-playwright-version@v1

  playwright:
    name: 'Run Playwright Tests'
    runs-on: ubuntu-latest
    needs: read-playwright-version
    container:
      image: mcr.microsoft.com/playwright:${{ needs.read-playwright-version.outputs.playwright-version }}-noble
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - name: Install dependencies
        run: npm ci
      - name: Run your tests
        run: npx playwright test
        env:
          HOME: /root

Inputs

Name Description Default
no-version-found The message level when no Playwright version is found (error, warning, info) error

Outputs

Name Description Example
playwright-version The playwright version from the package-lock.json v1.47.1

Sources

Thanks to @mxschmitt for coming up with the workflow this action is based on.

Get Playwright Version is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Get the Playwright Version from the project lockfile
v1.2.0
Latest

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Get Playwright Version is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.