Skip to content

update-npm-version

update-npm-version #8

name: update-npm-version
# https://github.com/forcedotcom/cli/issues/2327
# Customer needs an npm version that has been bundled with node lts
# We will install the version that is included with the runner's node
on:
workflow_dispatch:
schedule:
# Tuesday 7a central (12 UTC)
- cron: '0 12 * * 2'
jobs:
update-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn add npm@$(npm -v)
- uses: salesforcecli/github-workflows/.github/actions/gitConfig@main
# Push changes if 'git status' is not empty
- run: |
if [[ -n $(git status --short) ]]; then
npm install @salesforce/cli -g
yarn test:nuts
git add -A
git commit -m "fix: update npm version"
git push
else
echo "Already up to date"
fi