|
| 1 | +name: Update TanStack Dependencies |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # Run weekly on Sundays at 10:00 AM UTC |
| 7 | + - cron: '0 10 * * 0' |
| 8 | + |
| 9 | +jobs: |
| 10 | + update-deps: |
| 11 | + name: Update TanStack Dependencies |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Git Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + |
| 19 | + - name: Setup pnpm |
| 20 | + uses: pnpm/action-setup@v4 |
| 21 | + |
| 22 | + - name: Setup Node |
| 23 | + uses: actions/setup-node@v4 |
| 24 | + with: |
| 25 | + node-version-file: .nvmrc |
| 26 | + cache: pnpm |
| 27 | + |
| 28 | + - name: Install Packages |
| 29 | + run: pnpm install --frozen-lockfile |
| 30 | + |
| 31 | + - name: Update TanStack Dependencies |
| 32 | + run: pnpm up "@tanstack/*" --latest |
| 33 | + |
| 34 | + - name: Check for Changes |
| 35 | + id: git-check |
| 36 | + run: | |
| 37 | + git status --porcelain . |
| 38 | + if [[ -z $(git status --porcelain .) ]]; then |
| 39 | + echo "No changes detected" |
| 40 | + echo "changes=false" >> $GITHUB_OUTPUT |
| 41 | + else |
| 42 | + echo "Changes detected" |
| 43 | + echo "changes=true" >> $GITHUB_OUTPUT |
| 44 | + fi |
| 45 | +
|
| 46 | + - name: Run Lint |
| 47 | + if: steps.git-check.outputs.changes == 'true' |
| 48 | + run: pnpm lint |
| 49 | + |
| 50 | + - name: Run Build |
| 51 | + if: steps.git-check.outputs.changes == 'true' |
| 52 | + run: pnpm build |
| 53 | + |
| 54 | + - name: Commit and Push Changes |
| 55 | + if: steps.git-check.outputs.changes == 'true' |
| 56 | + run: | |
| 57 | + git config --local user.email "action@github.com" |
| 58 | + git config --local user.name "GitHub Action" |
| 59 | + git add . |
| 60 | + git commit -m "chore: update @tanstack/* dependencies" |
| 61 | + git push |
0 commit comments