2022-07-11 16:27:44 +03:00
|
|
|
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
|
2022-08-30 14:12:36 +03:00
|
|
|
if: github.repository == 'microsoft/playwright'
|
2022-07-11 16:27:44 +03:00
|
|
|
steps:
|
2022-08-31 18:23:42 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-07-11 16:27:44 +03:00
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
- 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
|
2023-02-08 18:53:07 +03:00
|
|
|
echo "HAS_CHANGES=1" >> $GITHUB_OUTPUT
|
2022-07-11 16:27:44 +03:00
|
|
|
BRANCH_NAME="roll-driver-nodejs/$(date +%Y-%b-%d)"
|
2023-02-08 18:53:07 +03:00
|
|
|
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
2022-07-11 16:27:44 +03:00
|
|
|
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' }}
|
2022-08-31 18:23:42 +03:00
|
|
|
uses: actions/github-script@v6
|
2022-07-11 16:27:44 +03:00
|
|
|
with:
|
|
|
|
script: |
|
2022-08-31 18:23:42 +03:00
|
|
|
await github.rest.pulls.create({
|
2022-07-11 16:27:44 +03:00
|
|
|
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',
|
|
|
|
});
|