Skip to content

Commit 3d9d286

Browse files
committed
Workflow: Get playwright version from package.json
1 parent a121085 commit 3d9d286

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/playwright.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,31 @@ on:
99

1010
env:
1111
FRONT_DOOR_USERNAME: ${{ secrets.FRONT_DOOR_USERNAME }}
12-
FRONT_DOOR_PASSWORD: ${{ secrets.FRONT_DOOR_PASSWORD }}
12+
FRONT_DOOR_PASSWORD: ${{ secrets.FRONT_DOOR_PASSWORD }}
1313
COVEO_CREDENTIALS_BASE_URL: ${{ secrets.COVEO_CREDENTIALS_BASE_URL }}
14-
BROWSERS: "webkit firefox"
1514
jobs:
16-
playwright:
15+
get-playwright-version:
16+
name: Get Playwright Version
17+
runs-on: ubuntu-latest
18+
outputs:
19+
version: ${{ steps.get-playwright-version.outputs.version }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
23+
- name: Get version from package.json
24+
id: get-playwright-version
25+
run: |
26+
cd tests
27+
version=$(npm list @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')
28+
test -n "$version" || { echo "No @playwright/test version found in package.json"; exit 1; }
29+
echo "version=$version" >> $GITHUB_OUTPUT
30+
echo "Version: " $version
31+
run-playwright:
1732
name: Run Playwright
33+
needs: get-playwright-version
1834
runs-on: ubuntu-latest
1935
container:
20-
image: mcr.microsoft.com/playwright:v1.55.1-jammy
36+
image: mcr.microsoft.com/playwright:v${{needs.get-playwright-version.outputs.version}}-jammy
2137
steps:
2238
# Checkout the repository so the workflow has access to the code
2339
- name: Checkout code

0 commit comments

Comments
 (0)