keeps npm dependencies up-to-date by making pull requests from GitHub Actions or CI.
This tool keeps npm dependencies up-to-date by making pull requests from GitHub Actions or CI.
This tool is the successor of taichi/ci-yarn-upgrade.
GitHub Action for package.json update.
Below is the complete workflow example:
name: Update
on:
schedule:
- cron: 0 0 * * 3
jobs:
package-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: set remote url
run: git remote set-url --push origin https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: john
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_LEVEL: debug
with:
args: -u --packageFile package.json --loglevel verbose
Notes:
args
are passed to npm-check-updates.AUTHOR_NAME
and AUTHOR_EMAIL
are use for the commit.EXECUTE
as true,
then actions-package-update makes a Pull Request.GITHUB_TOKEN
value as above, because actions-package-update access to your repository and make Pull Request.
Update devDependencies
only
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: John
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: -u --packageFile package.json --dep dev
Use yarn upgrade
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: John
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATE_COMMAND: yarn
with:
args: upgrade --latest
Use npm update
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: John
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATE_COMMAND: npm
with:
args: update
Use pnpm update
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: John
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATE_COMMAND: pnpm
with:
args: update
Use ncu with yarn workspaces
In your workspace root, run:
yarn add -DW wsrun npm-check-updates
Add this script to your root package.json:
{
"ncu-all": "ncu -u --packageFile package.json && wsrun --serial ncu -u --packageFile package.json"
}
Add this config:
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: John
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATE_COMMAND: yarn
with:
args: ncu-all
yarn global add actions-package-update
or
npm install actions-package-update -g
or
pnpm add --global actions-package-update
GITHUB_TOKEN
AUTHOR_NAME
and AUTHOR_EMAIL
EXECUTE
EXECUTE=true
, then this command push branch to remote, and make a pull request.This command works locally and output result to standard output.
BRANCH_PREFIX
package-update/
.COMMIT_MESSAGE
update dependencies
.COMMIT_FILES
git add --all
.
"package.json package-lock.json"
to ensure only these two files gets added to the commitUPDATE_COMMAND
ncu
.
yarn
or npm
.WITH_SHADOWS
false
.KEEP
false
.LOG_LEVEL
fatal
, error
, warn
, info
, debug
, trace
or silent
.info
.debug
.WORKING_DIR
./
.SET_NODE_VERSION
latest
.Run these commands in the project root dir.
yarn install
code .
release package to npmjs
yarn publish
edit Dockerfile