Skip to content

Commit

Permalink
Sync branch improvements (#6172)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittjoseph authored Mar 4, 2024
1 parent dc02b47 commit 66b7d1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

###############################################################################
# Define branch specific files by overriding the merge driver
# Must be kept in sync with .github\workflows\sync-branches.yml
###############################################################################
global.json merge=ours
eng/branch-vscode-config merge=ours
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Sync branch
run: |
git checkout "$base_branch" -- \
git checkout --no-overlay "$base_branch" -- \
".github" \
".devcontainer" \
".vscode" \
Expand Down Expand Up @@ -78,14 +78,12 @@ jobs:
git config merge.ours.driver true
git merge "$base_branch" --strategy=ort --strategy-option=theirs
# Must be kept in sync with .gitattributes
git checkout "origin/${{ matrix.branch }}" -- \
"global.json" \
"eng/branch-vscode-config" \
"eng/common" \
"eng/Common.props" \
"eng/Versions.props" \
"eng/Version.Details.xml"
matches=$(perl -ne '/^([^\s]+)\s+merge=ours/gm && print "$1 "' .gitattributes)
for match in $matches; do
git checkout --no-overlay "$target_branch" -- "$match"
done
env:
target_branch: origin/${{ matrix.branch }}

- name: Open PR
uses: ./.github/actions/open-pr
Expand Down

0 comments on commit 66b7d1a

Please sign in to comment.