Skip to content

Commit 157d419

Browse files
committed
Add token to enable PR
1 parent 09dd5b7 commit 157d419

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/check-for-update.yml

+14
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,27 @@ jobs:
1818

1919
- run: |
2020
npm ci
21+
VERSION_BEFORE=`node --eval 'console.log(require("./package.json").version)'`
2122
./update.js --no-commit
2223
VERSION=`node --eval 'console.log(require("./package.json").version)'`
24+
if [ "$VERSION" == "$VERSION_BEFORE" ]; then
25+
echo "No update needed"
26+
exit 0
27+
fi
2328
echo "NEW_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
2429
id: update
2530
name: Run update
2631
32+
- uses: tibdex/github-app-token@v1
33+
id: generate-token
34+
if: steps.update.outputs.NEW_VERSION != ''
35+
with:
36+
app_id: ${{ secrets.APP_ID }}
37+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
38+
2739
- uses: peter-evans/create-pull-request@v5
2840
name: Create Pull Request
41+
if: steps.update.outputs.NEW_VERSION != ''
2942
with:
3043
commit-message: Bump version to ${{ steps.update.outputs.NEW_VERSION }}
3144
branch: update-${{ steps.update.outputs.NEW_VERSION }}
@@ -38,3 +51,4 @@ jobs:
3851
update chromedriver
3952
assignees: giggio
4053
reviewers: giggio
54+
token: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)