2021-08-17 15:23:40 +03:00
|
|
|
name: Roll Browser into Playwright
|
|
|
|
|
|
|
|
on:
|
|
|
|
repository_dispatch:
|
|
|
|
types: [roll_into_pw]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
roll:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-08-17 15:23:40 +03:00
|
|
|
with:
|
2022-04-26 17:59:47 +03:00
|
|
|
node-version: 14
|
2022-04-26 18:52:10 +03:00
|
|
|
- run: npm i -g npm@8
|
2021-08-17 15:23:40 +03:00
|
|
|
- run: npm ci
|
|
|
|
- run: npm run build
|
2021-08-17 15:36:44 +03:00
|
|
|
- name: Install dependencies
|
2021-10-11 17:52:17 +03:00
|
|
|
run: npx playwright install-deps
|
2021-08-17 15:23:40 +03:00
|
|
|
- name: Roll to new revision
|
|
|
|
run: |
|
|
|
|
./utils/roll_browser.js ${{ github.event.client_payload.browser }} ${{ github.event.client_payload.revision }}
|
2021-08-30 18:46:32 +03:00
|
|
|
npm run build
|
2021-08-17 15:23:40 +03:00
|
|
|
- name: Prepare branch
|
|
|
|
id: prepare-branch
|
|
|
|
run: |
|
2021-08-18 11:15:36 +03:00
|
|
|
BRANCH_NAME="roll-into-pw-${{ github.event.client_payload.browser }}/${{ github.event.client_payload.revision }}"
|
2021-08-17 15:23:40 +03:00
|
|
|
echo "::set-output name=BRANCH_NAME::$BRANCH_NAME"
|
|
|
|
git config --global user.name github-actions
|
|
|
|
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
|
|
git checkout -b "$BRANCH_NAME"
|
|
|
|
git add .
|
|
|
|
git commit -m "feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}"
|
|
|
|
git push origin $BRANCH_NAME
|
|
|
|
- name: Create Pull Request
|
2022-08-31 18:23:42 +03:00
|
|
|
uses: actions/github-script@v6
|
2021-08-17 15:23:40 +03:00
|
|
|
with:
|
2022-08-11 00:03:41 +03:00
|
|
|
github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}
|
2021-08-17 15:23:40 +03:00
|
|
|
script: |
|
2022-08-31 18:23:42 +03:00
|
|
|
const response = await github.rest.pulls.create({
|
2021-08-17 15:23:40 +03:00
|
|
|
owner: 'microsoft',
|
|
|
|
repo: 'playwright',
|
|
|
|
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
|
2021-12-08 09:58:33 +03:00
|
|
|
base: 'main',
|
2021-08-17 15:36:44 +03:00
|
|
|
title: 'feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}',
|
2021-08-17 15:23:40 +03:00
|
|
|
});
|
2022-08-31 18:23:42 +03:00
|
|
|
await github.rest.issues.addLabels({
|
2022-05-17 17:54:33 +03:00
|
|
|
owner: 'microsoft',
|
|
|
|
repo: 'playwright',
|
|
|
|
issue_number: response.data.number,
|
|
|
|
labels: ['CQ1'],
|
|
|
|
});
|