From 157d4190d997f50e79159068bdee45c1762bbb9f Mon Sep 17 00:00:00 2001 From: Giovanni Bassi Date: Sat, 14 Oct 2023 00:25:26 -0300 Subject: [PATCH] Add token to enable PR --- .github/workflows/check-for-update.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check-for-update.yml b/.github/workflows/check-for-update.yml index ceefd78..fb95f81 100644 --- a/.github/workflows/check-for-update.yml +++ b/.github/workflows/check-for-update.yml @@ -18,14 +18,27 @@ jobs: - run: | npm ci + 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 }} @@ -38,3 +51,4 @@ jobs: update chromedriver assignees: giggio reviewers: giggio + token: ${{ steps.generate-token.outputs.token }}