Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/update-release-pr.yml
Original file line number Diff line number Diff line change
@@ -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