From ed08b867ae868255d66e2bf07b576c432c68c284 Mon Sep 17 00:00:00 2001 From: KieranRobson Date: Thu, 20 Jul 2023 12:32:36 +0100 Subject: [PATCH] chore: Clean up dependency updater --- .github/workflows/yarn-upgrader.yml | 35 ++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/yarn-upgrader.yml b/.github/workflows/yarn-upgrader.yml index abda25f..59af642 100644 --- a/.github/workflows/yarn-upgrader.yml +++ b/.github/workflows/yarn-upgrader.yml @@ -1,9 +1,16 @@ -name: Update Dependencies +name: Update dependencies on: workflow_dispatch: schedule: - cron: '0 8 * * MON' + push: + branches: + - main + paths: + - '**/package.json' + - '**/pnpm-lock.yaml' + - 'scripts/**' jobs: build: @@ -30,11 +37,33 @@ jobs: run: | yarn run format + - name: Gen Body + run: | + echo 'git_body<> $GITHUB_ENV + git --no-pager diff --compact-summary >> $GITHUB_ENV + echo 'DIFF' >> $GITHUB_ENV + # Open a pull request if there are any changes - name: Create Pull Request uses: peter-evans/create-pull-request@v5.0.2 with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/yarn-upgrade - title: 'chore(deps): Upgrade dependencies' - commit-message: 'chore(deps): Run yarn upgrade' + title: 'chore(deps): Bump yarn dependencies' + commit-message: 'chore(deps): Bump yarn dependencies' + labels: | + dependencies + javascript + body: | + Update yarn dependencies + + ${{ env.git_body }} + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + + - name: Enable Pull Request Automatic Merge + run: gh pr merge --merge --auto "1" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}