From 2d7a7c8c57315268c6fee0b167b6e255a56c2b22 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 5 Feb 2026 08:38:09 +0100 Subject: [PATCH] Add workflow to fix Dependabot lockfile This workflow automatically regenerates the npm lockfile when Dependabot opens or updates a pull request, ensuring dependencies are up to date with the specified Node and npm versions. --- .github/workflows/dependabot-fix.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/dependabot-fix.yml diff --git a/.github/workflows/dependabot-fix.yml b/.github/workflows/dependabot-fix.yml new file mode 100644 index 0000000..f5a39f9 --- /dev/null +++ b/.github/workflows/dependabot-fix.yml @@ -0,0 +1,46 @@ +name: Fix Dependabot lockfile + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: write + pull-requests: write + +jobs: + regen-lockfile: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 24.13.0 + cache: npm + + - name: Pin npm + run: npm i -g npm@11.8.0 + + - name: Regenerate lockfile with repo toolchain + run: | + rm -rf node_modules + npm install --package-lock-only + + - name: Commit lockfile if changed + run: | + if git diff --quiet -- package-lock.json; then + echo "No lockfile changes" + exit 0 + fi + + git config user.name "dependabot[bot]" + git config user.email "49699333+dependabot[bot]@users.noreply.github.com" + git add package-lock.json + git commit -m "chore(deps): regenerate lockfile with Node 24 / npm 11.8" + git push