Auto dependency updater #984
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 * * 0' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - base: main | |
| version: v3 | |
| - base: release/2 | |
| version: v2 | |
| env: | |
| version: ${{ matrix.version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| 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 | |
| run: pnpm run update | |
| - name: Reinstall dependencies | |
| run: pnpm i --no-frozen-lockfile | |
| - 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 | |
| author: 'deleonio <6279703+deleonio@users.noreply.github.com>' | |
| commit-message: 'chore: update dependencies and lock file' | |
| committer: 'deleonio <6279703+deleonio@users.noreply.github.com>' | |
| title: 'chore(${{ env.version }}): update dependencies and lock file' | |
| body: 'Automated dependency updates from issue #${{ env.issue }} for ${{ env.version }}.' | |
| delete-branch: true | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - name: Quality Checks | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| pnpm build | |
| pnpm format | |
| pnpm lint | |
| pnpm unused |