From 0fc976c58686f7ecc6db73c1ed2454a7747e5663 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:27:41 +0000 Subject: [PATCH 1/5] Initial plan From df6d544c96f2de418f9e7d914d752dccaac1e508 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:38:01 +0000 Subject: [PATCH 2/5] Changes before error encountered Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- .github/WORKFLOWS.md | 61 +++++++++++++++++++++++++ .github/workflows/changelog.yml | 7 +++ .github/workflows/changeset-release.yml | 7 +++ 3 files changed, 75 insertions(+) diff --git a/.github/WORKFLOWS.md b/.github/WORKFLOWS.md index 7c6a75a6..e86effd7 100644 --- a/.github/WORKFLOWS.md +++ b/.github/WORKFLOWS.md @@ -338,6 +338,67 @@ Add these badges to show workflow status: 3. Update documentation 4. Monitor first few runs after changes +## Automatic Lockfile Merge Resolution + +### Overview + +The repository is configured to automatically resolve merge conflicts in `pnpm-lock.yaml` using a custom Git merge driver. This prevents manual intervention when lockfile conflicts occur during branch merges or automated workflows. + +### How It Works + +**Repository Configuration** (`.gitattributes`): +``` +pnpm-lock.yaml merge=pnpm-merge +``` + +This tells Git to use the `pnpm-merge` driver when merging `pnpm-lock.yaml` files. + +**Workflow Configuration** (Applied in CI workflows): +```yaml +- name: Configure Git merge driver for pnpm-lock.yaml + run: | + # Configure custom merge driver for pnpm-lock.yaml + # This allows Git to automatically resolve lockfile conflicts by regenerating it + git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver" + git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile" +``` + +### When It's Used + +This configuration is active in the following workflows: +- **Changeset Release** (`changeset-release.yml`): Handles lockfile updates during version bumping +- **Auto Changelog** (`changelog.yml`): Prevents conflicts during automated changelog updates + +### Adding to New Workflows + +If you create a workflow that performs git merge operations or might encounter lockfile conflicts, add the configuration step **after checkout** and **before any merge operation**: + +```yaml +steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git merge driver for pnpm-lock.yaml + run: | + git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver" + git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile" + + # ... rest of your workflow steps including merge operations +``` + +### Benefits + +- **Fully Automated**: No manual intervention needed for lockfile conflicts +- **Clean Repository**: Configuration is temporary (CI-only), doesn't modify repository files +- **Reliable**: Uses pnpm's built-in dependency resolution to regenerate lockfiles +- **Consistent**: Ensures lockfiles are always in sync with package.json changes + +### Local Development + +For local development, contributors can configure the same merge driver by following the instructions in [CONTRIBUTING.md](../CONTRIBUTING.md). + ## Future Enhancements Potential workflow additions: diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 110360cc..f71c7ee8 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -18,6 +18,13 @@ jobs: with: fetch-depth: 0 + - name: Configure Git merge driver for pnpm-lock.yaml + run: | + # Configure custom merge driver for pnpm-lock.yaml + # This allows Git to automatically resolve lockfile conflicts by regenerating it + git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver" + git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile" + - name: Generate changelog uses: orhun/git-cliff-action@v4 id: changelog diff --git a/.github/workflows/changeset-release.yml b/.github/workflows/changeset-release.yml index 666719f5..f3a7c56e 100644 --- a/.github/workflows/changeset-release.yml +++ b/.github/workflows/changeset-release.yml @@ -34,6 +34,13 @@ jobs: cache: 'pnpm' registry-url: 'https://registry.npmjs.org' + - name: Configure Git merge driver for pnpm-lock.yaml + run: | + # Configure custom merge driver for pnpm-lock.yaml + # This allows Git to automatically resolve lockfile conflicts by regenerating it + git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver" + git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile" + - name: Install dependencies run: pnpm install --frozen-lockfile From 6cb562d7ab4b0ea69bdcab1f7b2c35c0da0d8001 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:49:24 +0000 Subject: [PATCH 3/5] feat: add pnpm-lock.yaml merge driver to dependabot workflow Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/workflows/dependabot-auto-merge.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 013d5fc5..31fe25b8 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,6 +13,16 @@ jobs: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Configure Git merge driver for pnpm-lock.yaml + run: | + # Configure custom merge driver for pnpm-lock.yaml + # This allows Git to automatically resolve lockfile conflicts by regenerating it + git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver" + git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile" + - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v2 From 28d37dda3e8b9459755648244d78c9e2fc57fda3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:51:29 +0000 Subject: [PATCH 4/5] fix: add pnpm and node setup to dependabot workflow for merge driver Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/workflows/dependabot-auto-merge.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 31fe25b8..0b9388d4 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -16,6 +16,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'pnpm' + - name: Configure Git merge driver for pnpm-lock.yaml run: | # Configure custom merge driver for pnpm-lock.yaml From da32d41814bd9aec260d9d5800f1dadee776d482 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:53:11 +0000 Subject: [PATCH 5/5] chore: standardize pnpm version to 10 across changeset workflows Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/workflows/changeset-check.yml | 2 +- .github/workflows/changeset-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changeset-check.yml b/.github/workflows/changeset-check.yml index 96337601..0d5eaea6 100644 --- a/.github/workflows/changeset-check.yml +++ b/.github/workflows/changeset-check.yml @@ -25,7 +25,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: 10 - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/.github/workflows/changeset-release.yml b/.github/workflows/changeset-release.yml index f3a7c56e..4177742e 100644 --- a/.github/workflows/changeset-release.yml +++ b/.github/workflows/changeset-release.yml @@ -25,7 +25,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: 10 - name: Setup Node.js uses: actions/setup-node@v4