From 801cd815aed9704888a27277128f39e7b89804d2 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 23 Aug 2023 11:05:14 -0500 Subject: [PATCH] chore: npm update workflow --- .github/dependabot.yml | 1 + .github/workflows/update-npm-version.yml | 32 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/update-npm-version.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0ef035df..7cc4b82e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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'] diff --git a/.github/workflows/update-npm-version.yml b/.github/workflows/update-npm-version.yml new file mode 100644 index 00000000..82d0460b --- /dev/null +++ b/.github/workflows/update-npm-version.yml @@ -0,0 +1,32 @@ +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 + git add -A + git commit -m "fix: update npm version" + git push + else + echo "Already up to date" + fi