File: roll_driver_nodejs.yml

package info (click to toggle)
node-playwright 1.38.0%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,720 kB
  • sloc: javascript: 114,018; sh: 899; java: 372; xml: 247; cs: 118; python: 29; makefile: 13
file content (46 lines) | stat: -rw-r--r-- 1,789 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "PR: bump driver Node.js"
on:
  workflow_dispatch:
  schedule:
    # At 10:00am UTC  (3AM PST) every tuesday and thursday to roll to new Node.js driver
    - cron: "0 10 * * 2,4"
jobs:
  trigger-nodejs-roll:
    name: Trigger Roll
    runs-on: ubuntu-22.04
    if: github.repository == 'microsoft/playwright'
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - run: node utils/build/update-playwright-driver-version.mjs
      - name: Prepare branch
        id: prepare-branch
        run: |
          if [[ "$(git status --porcelain)" == "" ]]; then
              echo "there are no changes";
              exit 0;
          fi
          echo "HAS_CHANGES=1" >> $GITHUB_OUTPUT
          BRANCH_NAME="roll-driver-nodejs/$(date +%Y-%b-%d)"
          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 "chore(driver): roll driver to recent Node.js LTS version"
          git push origin $BRANCH_NAME
      - name: Create Pull Request
        if: ${{ steps.prepare-branch.outputs.HAS_CHANGES == '1' }}
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}
          script: |
            await github.rest.pulls.create({
              owner: 'microsoft',
              repo: 'playwright',
              head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
              base: 'main',
              title: 'chore(driver): roll driver to recent Node.js LTS version',
            });