roll_into_pw #1274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Roll Browser into Playwright | |
on: | |
repository_dispatch: | |
types: [roll_into_pw] | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
permissions: | |
contents: write | |
jobs: | |
roll: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: npm run build | |
- name: Install dependencies | |
run: npx playwright install-deps | |
- name: Roll to new revision | |
run: | | |
./utils/roll_browser.js ${{ github.event.client_payload.browser }} ${{ github.event.client_payload.revision }} | |
npm run build | |
- name: Prepare branch | |
id: prepare-branch | |
run: | | |
BRANCH_NAME="roll-into-pw-${{ github.event.client_payload.browser }}/${{ github.event.client_payload.revision }}" | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT | |
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 | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }} | |
script: | | |
const response = await github.rest.pulls.create({ | |
owner: 'microsoft', | |
repo: 'playwright', | |
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}', | |
base: 'main', | |
title: 'feat(${{ github.event.client_payload.browser }}): roll to r${{ github.event.client_payload.revision }}', | |
}); | |
await github.rest.issues.addLabels({ | |
owner: 'microsoft', | |
repo: 'playwright', | |
issue_number: response.data.number, | |
labels: ['CQ1'], | |
}); |