From 6b17c00a8013c1c611b2d917148a846077c488ec Mon Sep 17 00:00:00 2001 From: Nora Blomaard Date: Wed, 20 May 2026 09:10:06 +0200 Subject: [PATCH] chore: add workflow to update package-lock.json --- .github/workflows/update-release-pr.yml | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/update-release-pr.yml diff --git a/.github/workflows/update-release-pr.yml b/.github/workflows/update-release-pr.yml new file mode 100644 index 0000000000..f41269a74d --- /dev/null +++ b/.github/workflows/update-release-pr.yml @@ -0,0 +1,43 @@ +name: Update Release PR + +on: + pull_request: + types: [opened, synchronize] + branches: + - main + +jobs: + update-lockfile: + # Only run on release-please PRs + if: startsWith(github.head_ref, 'release-please--') + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Update package-lock.json + run: npm install --package-lock-only + + - name: Check for changes + id: git-check + run: | + git diff --exit-code package-lock.json || echo "changed=true" >> $GITHUB_OUTPUT + + - name: Commit changes + if: steps.git-check.outputs.changed == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add package-lock.json + git commit -m "chore: update package-lock.json" + git push