Skip to content

Dependency updater

Dependency updater #24

name: Dependency updater
on:
workflow_dispatch: # enable run button on github.com
schedule:
- cron: "30 0 1 * *" # On the 1st of the month at 00:30.
jobs:
update:
name: Update dependencies
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: "./package-lock.json"
- name: Update dependencies
run: npx npm-check-updates -u
- name: Install dependencies, build, and test
run: npm install
- name: Build site
run: npm run test
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PUSH_TOKEN }}
commit-message: Update dependencies
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: dependencies
delete-branch: true
title: "Update NPM dependencies"
body: |
Updated NPM dependencies via GitHub Action