Skip to content

Commit

Permalink
feat: add auto-update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jun 30, 2024
1 parent 70061b4 commit f685f74
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push, fork, pull_request, workflow_dispatch]
on: [push, fork, pull_request, workflow_dispatch, workflow_call]

jobs:

Expand All @@ -19,6 +19,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Pull changes
run: git pull

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Auto update

on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *

jobs:
taze:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Set node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm

- name: Check updates
id: taze
run: pnpx taze -a --failOnOutdated
continue-on-error: true

- name: Updates dependencies
if: steps.taze.outcome == 'failure'
run: |
pnpx taze -w
pnpm update
- name: Commit changes
if: steps.taze.outcome == 'failure'
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add package.json pnpm-lock.yaml
git commit -m 'chore(deps): update dependencies'
git push
echo "updated=true" >> $GITHUB_OUTPUT
lint:
needs: taze
uses: ./.github/workflows/ci.yml
if: needs.taze.outputs.updated == 'true'

0 comments on commit f685f74

Please sign in to comment.