From 90c06a665f4d4a341d9bcded825d529a559b9d2a Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sun, 30 Jun 2024 19:32:46 +0800 Subject: [PATCH] feat: add auto-update workflow --- .github/workflows/update.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..580b9b2 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,43 @@ +name: Auto update + +on: + workflow_dispatch: + schedule: + - cron: 0 0 * * * + +jobs: + taze: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: latest + + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: pnpm + + - name: Check updates + id: taze + run: pnpx taze -a --failOnOutdated + continue-on-error: true + - name: Updates dependencies + if: steps.taze.outcome == 'failure' + run: | + pnpx taze -w + pnpm update + - name: Commit changes + if: steps.taze.outcome == 'failure' + run: | + git config --local user.name 'github-actions[bot]' + git config --local user.email 'github-actions[bot]@users.noreply.github.com' + git add package.json pnpm-lock.yaml + git commit -m 'chore(deps): update dependencies' + git push