Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npm update workflow #647

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ updates:
prefix-development: chore(dev-deps)
ignore:
- dependency-name: '@salesforce/dev-scripts'
- dependency-name: 'npm' # Updated with update-npm-version.yml
- dependency-name: '*'
update-types: ['version-update:semver-major']
1 change: 1 addition & 0 deletions .github/workflows/failureNotifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflows:
- version, tag and github release
- publish
- update-npm-version
types:
- completed

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-npm-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
yarn test
git add -A
git commit -m "fix: update npm version"
git push
else
echo "Already up to date"
fi
Loading