Skip to content

Commit

Permalink
Create update.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
peteryang1756 authored Jan 24, 2025
0 parents commit 01d143a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Dependencies

on:
push:
branches:
- main

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # You can change the Node.js version as needed

- name: Install dependencies
run: |
npm init -y # Use npm ci for a clean install based on package-lock.json
- name: Remove pagedone package
run: |
npm install express body-parser mysql2
- name: Commit changes
run: |
git config --local user.name "github-actions"
git config --local user.email "[email protected]"
git add package.json package-lock.json
git diff --cached --quiet || git commit -m "chore: update dependencies" # Commit only if there are changes
git push origin main # Specify the remote and branch to push to
- name: Run tests
run: |
npm test # Run tests if you have a test script

0 comments on commit 01d143a

Please sign in to comment.