generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (48 loc) · 1.96 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 9a central (14 UTC)
- cron: '0 14 * * 2'
jobs:
update-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: |
# NOTE: Both @salesforce/plugin-trust and @oclif/plugin-plugins require npm.
# In order to ensure that we are not duplicating pinned npm versions
# and increasing the CLI bundle size, we get the version from plugin-plugins
NPM=$(curl https://raw.githubusercontent.com/oclif/plugin-plugins/main/package.json | jq -r '.dependencies.npm')
echo "Current package.json npm version: $(jq '.dependencies.npm' package.json)"
echo "Version in @oclif/plugin-plugins: $NPM"
yarn add npm@$NPM
- uses: salesforcecli/github-workflows/.github/actions/getGithubUserInfo@main
id: github-user-info
with:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
- uses: salesforcecli/github-workflows/.github/actions/gitConfig@main
with:
username: ${{ steps.github-user-info.outputs.username }}
email: ${{ steps.github-user-info.outputs.email }}
# Push changes if 'git status' is not empty
- run: |
if [[ -n $(git status --short) ]]; then
npm install @salesforce/cli -g
yarn build
yarn test:nuts
git add -A
git commit -m "fix: update npm version"
git push
else
echo "Already up to date"
fi