You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Get Playwright Version
v1.1.1
This parses the package-lock.json and returns the project's current playwright version.
If no version is found, it will return latest
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.
Define whatever your action needs to run here
name: Playwright Tests
on:
push:
branches: [ main, master ]
jobs:
read-playwright-version:
name: 'Read Playwright Version'
runs-on: ubuntu-latest
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
Name | Description | Example |
---|---|---|
playwright-version |
The playwright version from the package-lock.json | v1.47.1 |
Thanks to @mxschmitt for coming up with the workflow this action is based on.