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 cd9887c
Show file tree
Hide file tree
Showing 2 changed files with 61 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
57 changes: 57 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Auto update

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

jobs:
taze:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
updated: ${{ steps.set-output.outputs.updated }}
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
- name: Set output
id: set-output
if: steps.taze.outcome == 'failure'
run: |
echo "updated=true" >> $GITHUB_OUTPUT
lint:
needs: taze
uses: ./.github/workflows/ci.yml
if: needs.taze.outputs.updated == 'true'

1 comment on commit cd9887c

@vercel
Copy link

@vercel vercel bot commented on cd9887c Jun 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.