-
-
Notifications
You must be signed in to change notification settings - Fork 183
54 lines (48 loc) · 1.68 KB
/
check-for-update.yml
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
47
48
49
50
51
52
53
54
---
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 }}