generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 1.08 KB
/
update-npm-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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