Auto dependency updater #858
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto dependency updater | |
| env: | |
| issue: 6350 | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' # Runs daily at 02:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - base: develop | |
| version: v4 | |
| - base: release/3 | |
| version: v3 | |
| - base: release/2 | |
| version: v2 | |
| # - base: release/1 | |
| # version: v1 | |
| env: | |
| version: ${{ matrix.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ matrix.base }} | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| # cache: pnpm | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v4 | |
| id: pnpm-install | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store | |
| - name: Install | |
| run: pnpm i --no-frozen-lockfile | |
| - name: Update dependencies (minor) | |
| run: pnpm ncu:minor | |
| - name: Reinstall dependencies | |
| run: pnpm i --no-frozen-lockfile | |
| - name: Fix format | |
| run: pnpm -r format -w | |
| - name: Check for changes | |
| id: verify-changed-files | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| base: ${{ matrix.base }} | |
| branch: ${{ env.issue }}-${{ env.version }}/auto-update-deps | |
| commit-message: 'chore: update dependencies and lock file' | |
| title: 'chore(${{ env.version }}): update dependencies and lock file' | |
| body: 'Automated dependency updates from issue #${{ env.issue }} for ${{ env.version }}.' | |
| delete-branch: true | |
| - name: Install Playwright browsers | |
| run: npx playwright install chromium | |
| - name: Quality Checks | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| pnpm build | |
| pnpm format | |
| pnpm lint | |
| pnpm test:unit | |
| pnpm test:e2e | |
| pnpm unused | |
| - name: Update dependencies (major) | |
| run: pnpm ncu:major |