Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Update update.yml #16

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 2 additions & 53 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,2 @@
name: Weekly Dependency Update

on:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight (UTC)

jobs:
update_dependencies:
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: '14'

- name: Install dependencies
run: npm install

- name: Check for updates
id: check_updates
run: |
CHANGES=$(npm outdated --json)
if [ "$CHANGES" == "null" ]; then
echo "No updates found."
echo "::set-output name=update_minor::false"
else
echo "Updates found."
echo "::set-output name=update_minor::true"
fi

- name: Update package version
if: steps.check_updates.outputs.update_minor == 'true'
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
git commit -am "Bump minor version"
git push --set-upstream origin ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update dependencies
if: steps.check_updates.outputs.update_minor == 'true'
run: npm update

- name: Push changes
if: steps.check_updates.outputs.update_minor == 'true'
uses: ad-m/github-push-action@v0.6.0
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Node Dependencies
uses: neverendingqs/gh-action-node-update-deps@v1.7.0
Loading