Skip to content

Commit a6e2671

Browse files
frangioernestognw
andcommitted
Fix release merge script (#4273)
Co-authored-by: Ernesto García <[email protected]> (cherry picked from commit 7e814a3)
1 parent 54b3f14 commit a6e2671

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/release/workflow/prepare-release-merge.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ MERGE_BRANCH=merge/$GITHUB_REF_NAME
99
git checkout -B "$MERGE_BRANCH" "$GITHUB_REF_NAME"
1010

1111
# Get deleted changesets in this branch that might conflict with master
12-
readarray -t DELETED_CHANGESETS < <(git diff origin/master --name-only -- '.changeset/*.md')
12+
# --diff-filter=D - Only deleted files
13+
readarray -t DELETED_CHANGESETS < <(git diff origin/master --diff-filter=D --name-only -- '.changeset/*.md')
1314

1415
# Merge master, which will take those files cherry-picked. Auto-resolve conflicts favoring master.
15-
git merge origin/master -m "Merge master to $GITHUB_REF_NAME" -X theirs
16+
# Ignore conflicts that can't be resolved.
17+
git merge origin/master -m "Merge master to $GITHUB_REF_NAME" -X theirs || true
1618

1719
# Remove the originally deleted changesets to correctly sync with master
1820
rm -f "${DELETED_CHANGESETS[@]}"
1921

20-
git add .changeset/
22+
# Only git add deleted files
23+
git ls-files --deleted .changeset/ | xargs git add
2124

2225
# Allow empty here since there may be no changes if `rm -f` failed for all changesets
2326
git commit --allow-empty -m "Sync changesets with master"

0 commit comments

Comments
 (0)