Skip to content

Commit 41a01f3

Browse files
committed
Accept Both Version Schemas in Workflow Inputs
1 parent 0b313ab commit 41a01f3

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

.github/workflows/check_patch_impact.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55
inputs:
66
old_version:
7-
description: Playwright version to compare from (e.g. 1.43.0 or v1.43.0)
7+
description: Playwright version to compare from (e.g. v1.43.0 or 1.43.0)
88
required: true
99
type: string
1010
new_version:
11-
description: Playwright version to compare to (e.g. 1.44.0 or v1.44.0)
11+
description: Playwright version to compare to (e.g. v1.44.0 or 1.44.0)
1212
required: true
1313
type: string
1414
create_issue:
@@ -19,11 +19,11 @@ on:
1919
workflow_call:
2020
inputs:
2121
old_version:
22-
description: Playwright version to compare from (e.g. 1.43.0 or v1.43.0)
22+
description: Playwright version to compare from (e.g. v1.43.0 or 1.43.0)
2323
required: true
2424
type: string
2525
new_version:
26-
description: Playwright version to compare to (e.g. 1.44.0 or v1.44.0)
26+
description: Playwright version to compare to (e.g. v1.44.0 or 1.44.0)
2727
required: true
2828
type: string
2929
create_issue:

.github/workflows/patchright_release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
workflow_dispatch:
66
inputs:
77
version:
8-
description: 'Playwright Version (e.g. v1.58.0)'
8+
description: 'Playwright Version (e.g. v1.58.0 or 1.58.0)'
99
default: ''
1010
patchright_release:
11-
description: 'Patchright Release Version (e.g. 1.58.0) on npm'
11+
description: 'Patchright Release Version (e.g. v1.58.0 or 1.58.0) on npm'
1212
default: ''
1313
# running every hour
1414
schedule:
@@ -36,13 +36,17 @@ jobs:
3636
id: version_check
3737
run: |
3838
if [ -n "${{ github.event.inputs.version }}" ]; then
39+
raw_version="${{ github.event.inputs.version }}"
40+
normalized_version="v${raw_version#v}"
3941
response=$(curl --silent "https://api.github.com/repos/${REPO}/releases/latest")
4042
previous_playwright_version=$(echo "$response" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
4143
echo "proceed=true" >>$GITHUB_OUTPUT
42-
echo "playwright_version=${{ github.event.inputs.version }}" >>$GITHUB_OUTPUT
44+
echo "playwright_version=${normalized_version}" >>$GITHUB_OUTPUT
4345
echo "previous_playwright_version=${previous_playwright_version:-v0.0.0}" >>$GITHUB_OUTPUT
44-
echo "playwright_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
46+
echo "playwright_version=${normalized_version}" >> $GITHUB_ENV
4547
elif [ -n "${{ github.event.inputs.patchright_release }}" ]; then
48+
raw_patchright_release="${{ github.event.inputs.patchright_release }}"
49+
normalized_patchright_release="${raw_patchright_release#v}"
4650
response=$(curl --silent "https://api.github.com/repos/microsoft/playwright/releases/latest")
4751
playwright_version=$(echo "$response" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
4852
@@ -53,6 +57,7 @@ jobs:
5357
echo "playwright_version=${playwright_version}" >>$GITHUB_OUTPUT
5458
echo "previous_playwright_version=${previous_playwright_version:-v0.0.0}" >>$GITHUB_OUTPUT
5559
echo "playwright_version=${playwright_version}" >> $GITHUB_ENV
60+
echo "patchright_release=${normalized_patchright_release}" >> $GITHUB_ENV
5661
else
5762
chmod +x utils/release_version_check.sh
5863
utils/release_version_check.sh

.github/workflows/patchright_tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
playwright_version:
7-
description: 'Playwright version (tag) to test against. If empty, latest release is used.'
7+
description: 'Playwright version (tag) to test against, e.g. v1.58.0 or 1.58.0. If empty, latest release is used.'
88
required: false
99
type: string
1010
outputs:
@@ -14,7 +14,7 @@ on:
1414
workflow_dispatch:
1515
inputs:
1616
playwright_version:
17-
description: 'Playwright version (tag) to test against. If empty, latest release is used.'
17+
description: 'Playwright version (tag) to test against, e.g. v1.58.0 or 1.58.0. If empty, latest release is used.'
1818
required: false
1919
type: string
2020
push:
@@ -50,6 +50,8 @@ jobs:
5050
if [ -z "$branch_version" ]; then
5151
response=$(curl --silent "https://api.github.com/repos/microsoft/playwright/releases/latest")
5252
branch_version=$(echo "$response" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
53+
else
54+
branch_version="v${branch_version#v}"
5355
fi
5456
git clone https://github.com/microsoft/playwright --branch "$branch_version"
5557
cd playwright

patchright-nodejs

0 commit comments

Comments
 (0)