File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,18 @@ MERGE_BRANCH=merge/$GITHUB_REF_NAME
9
9
git checkout -B " $MERGE_BRANCH " " $GITHUB_REF_NAME "
10
10
11
11
# 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' )
13
14
14
15
# 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
16
18
17
19
# Remove the originally deleted changesets to correctly sync with master
18
20
rm -f " ${DELETED_CHANGESETS[@]} "
19
21
20
- git add .changeset/
22
+ # Only git add deleted files
23
+ git ls-files --deleted .changeset/ | xargs git add
21
24
22
25
# Allow empty here since there may be no changes if `rm -f` failed for all changesets
23
26
git commit --allow-empty -m " Sync changesets with master"
You can’t perform that action at this time.
0 commit comments