From 4d5990800a97b7b84e971f01e43db6d238e8e2e1 Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 20 Aug 2025 21:20:16 +0000 Subject: [PATCH] chore: github action to auto update tanstack dependencies --- .github/workflows/update-tanstack-deps.yaml | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/update-tanstack-deps.yaml diff --git a/.github/workflows/update-tanstack-deps.yaml b/.github/workflows/update-tanstack-deps.yaml new file mode 100644 index 00000000..60f23f75 --- /dev/null +++ b/.github/workflows/update-tanstack-deps.yaml @@ -0,0 +1,61 @@ +name: Update TanStack Dependencies + +on: + workflow_dispatch: + schedule: + # Run weekly on Sundays at 10:00 AM UTC + - cron: '0 10 * * 0' + +jobs: + update-deps: + name: Update TanStack Dependencies + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: pnpm + + - name: Install Packages + run: pnpm install --frozen-lockfile + + - name: Update TanStack Dependencies + run: pnpm up "@tanstack/*" --latest + + - name: Check for Changes + id: git-check + run: | + git status --porcelain . + if [[ -z $(git status --porcelain .) ]]; then + echo "No changes detected" + echo "changes=false" >> $GITHUB_OUTPUT + else + echo "Changes detected" + echo "changes=true" >> $GITHUB_OUTPUT + fi + + - name: Run Lint + if: steps.git-check.outputs.changes == 'true' + run: pnpm lint + + - name: Run Build + if: steps.git-check.outputs.changes == 'true' + run: pnpm build + + - name: Commit and Push Changes + if: steps.git-check.outputs.changes == 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "chore: update @tanstack/* dependencies" + git push