Auto dependency updater #870
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 | |
on: | |
schedule: | |
- cron: "0 2 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
ref: "main" | |
- uses: ./.github/actions/pnpm-setup | |
- name: Create new branch | |
run: git checkout -b chore/auto-update-deps | |
- name: Show code | |
run: ls -la | |
working-directory: dev | |
- name: Install tools | |
run: npm i npm-check-updates --no-save --legacy-peer-deps | |
working-directory: dev | |
- name: Update dependencies | |
run: npm run update | |
working-directory: dev | |
- name: Reinstall dependencies | |
run: pnpm install --no-frozen-lockfile | |
working-directory: dev | |
- name: Commit changed files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add **/package.json **/pnpm-lock.yaml | |
git status | |
git commit -m "chore: auto dependency update" | |
- uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: "chore/auto-update-deps" | |
force: true |