superlint/.github/scripts/update-npm.sh
2022-02-21 10:41:13 -05:00

24 lines
588 B
Bash
Executable file

#!/usr/bin/env bash
# Enable strict error checking
set -euo pipefail
# Install ncu
npm i -g npm-check-updates
pushd dependencies
# Update all dependencies
ncu -u
npm install
# Setup Git Config
git config --global user.email "noreply@github.com"
git config --global user.name "Super-Linter Automation"
# Push changes to remote
git add .
git commit -a -Ss -m "Update NPM dependencies"
git checkout -b "npm_deps_${id}"
git push origin "npm_deps_${id}"
# Open pull request
gh pr create --title "Weekly NPM Updates" --body "Updates NPM dependencies" --base master --head "npm_deps_${id}"