Skip to content
Merged
Show file tree
Hide file tree
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
61 changes: 61 additions & 0 deletions .github/WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should also mention the Dependabot Auto-merge workflow (dependabot-auto-merge.yml) since it now has the merge driver configuration as well.

Suggested change
- **Auto Changelog** (`changelog.yml`): Prevents conflicts during automated changelog updates
- **Auto Changelog** (`changelog.yml`): Prevents conflicts during automated changelog updates
- **Dependabot Auto-merge** (`dependabot-auto-merge.yml`): Automatically resolves pnpm lockfile conflicts during Dependabot PR merges

Copilot uses AI. Check for mistakes.

### 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:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Comment on lines +21 to +27
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge driver is configured but pnpm is not installed in this workflow. The driver command 'pnpm install --no-frozen-lockfile' will fail if triggered because there are no pnpm setup steps. Either add pnpm/Node.js setup steps before this configuration, or remove this configuration if merge operations are not expected in this workflow.

Suggested change
- 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"

Copilot uses AI. Check for mistakes.
- name: Generate changelog
uses: orhun/git-cliff-action@v4
id: changelog
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/changeset-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- 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
# 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
Expand Down