Skip to content

Commit ed2ccaf

Browse files
Copilothotlong
andcommitted
Improve documentation and clarify workflow purpose
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ac10064 commit ed2ccaf

3 files changed

Lines changed: 29 additions & 13 deletions

File tree

.github/workflows/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ This directory contains automated workflows for the ObjectQL project.
66

77
### 🔄 auto-merge-dependabot.yml
88

9-
Automatically merges Dependabot pull requests with lockfile conflict resolution.
9+
Enables GitHub's auto-merge feature for Dependabot pull requests.
1010

1111
**Features:**
1212
- Runs only for PRs created by `dependabot[bot]`
13-
- Automatically resolves `pnpm-lock.yaml` conflicts using a temporary merge driver
14-
- Enables GitHub's auto-merge feature after successful merge
15-
- No permanent changes to repository configuration
13+
- Enables auto-merge (squash) on the PR
14+
- Relies on GitHub's merge queue and branch protection rules
15+
- Delegtes merge conflict handling to GitHub or other workflows
16+
17+
**Note:** This workflow doesn't implement the lockfile fix itself. For automatic lockfile conflict resolution, you can:
18+
1. Use the CI script approach in your CI workflow (see merge-with-lockfile-fix.yml)
19+
2. Configure branch protection rules that require CI to pass
20+
3. Use GitHub's merge queue feature
1621

1722
**How it works:**
18-
1. Configures a temporary merge driver in the CI environment
19-
2. Uses `.git/info/attributes` (not tracked by Git) to apply the driver
20-
3. Merges the base branch into the PR branch
21-
4. Regenerates lockfile if conflicts are detected
22-
5. Enables auto-merge for the PR
23+
1. Detects Dependabot PRs
24+
2. Enables auto-merge with squash strategy
25+
3. GitHub will merge the PR once all checks pass
2326

2427
### 🔧 merge-with-lockfile-fix.yml
2528

.github/workflows/auto-merge-dependabot.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: Auto-merge Dependabot PRs
22

3-
# This workflow demonstrates enabling auto-merge for Dependabot PRs.
4-
# GitHub's auto-merge will handle the actual merge, and if configured
5-
# with the CI script approach in the release/CI workflows, lockfile
6-
# conflicts will be automatically resolved.
3+
# This workflow enables auto-merge for Dependabot PRs.
4+
# It relies on GitHub's merge queue and branch protection rules to handle
5+
# the actual merge. For automatic lockfile conflict resolution, see
6+
# merge-with-lockfile-fix.yml or add the CI script approach to your CI workflow.
7+
#
8+
# To use the CI script approach in another workflow that runs on Dependabot PRs,
9+
# add the following before any git merge operation:
10+
#
11+
# git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver"
12+
# git config merge.pnpm-merge.driver "pnpm install --no-frozen-lockfile"
13+
# echo "pnpm-lock.yaml merge=pnpm-merge" >> .git/info/attributes
714

815
'on':
916
pull_request:

docs/CI_AUTO_MERGE_LOCKFILE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ Add this step before any `git merge` operation in your existing workflows:
8787

8888
The `--no-frozen-lockfile` flag allows pnpm to regenerate the lockfile if needed. This is essential for the merge driver to resolve conflicts by creating a new, consistent lockfile.
8989

90+
**Note:** The existing `scripts/setup-merge-driver.sh` uses just `pnpm install` without this flag. Both approaches work:
91+
- `pnpm install` - Simpler, relies on pnpm's default behavior
92+
- `pnpm install --no-frozen-lockfile` - Explicit, ensures lockfile can be updated
93+
94+
For CI environments, `--no-frozen-lockfile` is recommended to be explicit about the intent.
95+
9096
### Error Handling
9197

9298
If the merge fails for reasons other than lockfile conflicts, the workflow will:

0 commit comments

Comments
 (0)