File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,11 +87,14 @@ jobs:
8787 CONFLICT_FILES=$(git diff --name-only --diff-filter=U)
8888 echo "Conflicted files: $CONFLICT_FILES"
8989
90- if [ "$CONFLICT_FILES" = "pnpm-lock.yaml" ] || [ -z "$CONFLICT_FILES" ]; then
91- echo "Only pnpm-lock.yaml has conflicts or no conflicts. Regenerating lockfile..."
90+ # Only proceed if pnpm-lock.yaml is the only conflicted file
91+ if [ "$CONFLICT_FILES" = "pnpm-lock.yaml" ]; then
92+ echo "Only pnpm-lock.yaml has conflicts. Regenerating lockfile..."
9293
9394 # Remove the conflicted lockfile
94- git checkout --theirs pnpm-lock.yaml || git checkout --ours pnpm-lock.yaml || rm -f pnpm-lock.yaml
95+ # We remove it completely to let pnpm regenerate from package.json files
96+ # This ensures both branches' dependency changes are merged correctly
97+ rm -f pnpm-lock.yaml
9598
9699 # Regenerate the lockfile
97100 pnpm install --no-frozen-lockfile
You can’t perform that action at this time.
0 commit comments