Skip to content

Commit 6c2c902

Browse files
mxschmittdgozman
andauthored
devops(gha): allow workflow_dispatch in roll browser script (#34531)
Signed-off-by: Max Schmitt <max@schmitt.mx> Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
1 parent 7d8265e commit 6c2c902

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/roll_browser_into_playwright.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ name: Roll Browser into Playwright
33
on:
44
repository_dispatch:
55
types: [roll_into_pw]
6+
workflow_dispatch:
7+
inputs:
8+
browser:
9+
description: 'Browser name, e.g. chromium'
10+
required: true
11+
type: string
12+
revision:
13+
description: 'Browser revision without v prefix, e.g. 1234'
14+
required: true
15+
type: string
616

717
env:
818
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
19+
BROWSER: ${{ github.event.client_payload.browser || github.event.inputs.browser }}
20+
REVISION: ${{ github.event.client_payload.revision || github.event.inputs.revision }}
921

1022
permissions:
1123
contents: write
@@ -24,19 +36,19 @@ jobs:
2436
run: npx playwright install-deps
2537
- name: Roll to new revision
2638
run: |
27-
./utils/roll_browser.js ${{ github.event.client_payload.browser }} ${{ github.event.client_payload.revision }}
39+
./utils/roll_browser.js $BROWSER $REVISION
2840
npm run build
2941
- name: Prepare branch
3042
id: prepare-branch
3143
run: |
32-
BRANCH_NAME="roll-into-pw-${{ github.event.client_payload.browser }}/${{ github.event.client_payload.revision }}"
44+
BRANCH_NAME="roll-into-pw-${BROWSER}/${REVISION}"
3345
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
3446
git config --global user.name github-actions
3547
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
3648
git checkout -b "$BRANCH_NAME"
3749
git add .
38-
git commit -m "feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}"
39-
git push origin $BRANCH_NAME
50+
git commit -m "feat(${BROWSER}): roll to r${REVISION}"
51+
git push origin $BRANCH_NAME --force
4052
- name: Create Pull Request
4153
uses: actions/github-script@v7
4254
with:
@@ -47,7 +59,7 @@ jobs:
4759
repo: 'playwright',
4860
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
4961
base: 'main',
50-
title: 'feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}',
62+
title: 'feat(${{ env.BROWSER }}): roll to r${{ env.REVISION }}',
5163
});
5264
await github.rest.issues.addLabels({
5365
owner: 'microsoft',

0 commit comments

Comments
 (0)