Skip to content

Check for update

Check for update #330

---
name: "Check for update"
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
permissions:
pull-requests: write
jobs:
check-for-updates:
name: Check for updates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm ci --ignore-scripts --no-audit --no-fund
VERSION_BEFORE=`node --eval 'console.log(require("./package.json").version)'`
./update.js --no-commit
VERSION=`node --eval 'console.log(require("./package.json").version)'`
if [ "$VERSION" == "$VERSION_BEFORE" ]; then
echo "No update needed"
exit 0
fi
echo "NEW_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
id: update
name: Run update
- uses: tibdex/github-app-token@v1
id: generate-token
if: steps.update.outputs.NEW_VERSION != ''
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@v5
name: Create Pull Request
if: steps.update.outputs.NEW_VERSION != ''
with:
commit-message: Bump version to ${{ steps.update.outputs.NEW_VERSION }}
branch: update-${{ steps.update.outputs.NEW_VERSION }}
delete-branch: true
title: Bump version to ${{ steps.update.outputs.NEW_VERSION }}
body: |
Update Chromedriver to version `${{ steps.update.outputs.NEW_VERSION }}`.
See: https://googlechromelabs.github.io/chrome-for-testing/
labels: |
update chromedriver
assignees: giggio
reviewers: giggio
token: ${{ steps.generate-token.outputs.token }}