Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eviden-actions/get-playwright-version
Extracts and outputs the Playwright version from a project's lockfile
https://github.com/eviden-actions/get-playwright-version
actions cicd github github-actions lockfile playwright version
Last synced: 12 days ago
JSON representation
Extracts and outputs the Playwright version from a project's lockfile
- Host: GitHub
- URL: https://github.com/eviden-actions/get-playwright-version
- Owner: eviden-actions
- License: mit
- Created: 2024-09-19T10:37:35.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-20T22:28:52.000Z (16 days ago)
- Last Synced: 2024-10-21T02:41:49.402Z (16 days ago)
- Topics: actions, cicd, github, github-actions, lockfile, playwright, version
- Language: JavaScript
- Homepage:
- Size: 1.65 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# 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](https://mcr.microsoft.com/en-us/product/playwright/about) in your CI, Playwright strongly recommends using a [versioned tag](https://playwright.dev/docs/docker). This action can help you make sure your project's Playwright version matches the Playwright Docker Image version.
[![Release](https://github.com/eviden-actions/get-playwright-version/actions/workflows/release.yml/badge.svg#main)](https://github.com/eviden-actions/get-playwright-version/actions/workflows/release.yml)
## 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
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@v1playwright:
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
```### Outputs
| Name | Description | Example |
| :------------------: | :-----------------------------------------------: | :-------: |
| `playwright-version` | The playwright version from the package-lock.json | `v1.47.1` |## Sources
Thanks to [@mxschmitt](https://github.com/mxschmitt) for coming up with the [workflow](https://github.com/microsoft/playwright/issues/32483#issuecomment-2348193597) this action is based on.