Skip to content

Commit 341d855

Browse files
committed
Add test file and exclude workflow files from PR sync
1 parent cd97927 commit 341d855

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/sync-version-branches.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,26 @@ jobs:
121121
fi
122122
done
123123
124-
# Reset .csproj files and Directory.Build.props to target branch versions
125-
echo "📝 Resetting .csproj files and Directory.Build.props to ${{ matrix.target_branch }} versions..."
124+
# Reset files that should stay as they are in the target branch
125+
echo "📝 Resetting files that should remain from ${{ matrix.target_branch }}..."
126+
127+
# Reset all .csproj files
126128
find . -name "*.csproj" -type f -exec git checkout ${{ matrix.target_branch }} -- {} \;
127129
128-
# Also reset Directory.Build.props to keep the net8 version
130+
# Reset Directory.Build.props to keep the net8 version
129131
if [ -f "src/Directory.Build.props" ]; then
130132
echo "📝 Resetting Directory.Build.props to ${{ matrix.target_branch }} version..."
131133
git checkout ${{ matrix.target_branch }} -- src/Directory.Build.props
132134
133135
echo "Directory.Build.props from ${{ matrix.target_branch }}:"
134136
grep -E "<Version>|<TargetFramework>" src/Directory.Build.props
135137
fi
138+
139+
# Reset workflow files to avoid including workflow changes in the PR
140+
echo "📝 Resetting workflow files to ${{ matrix.target_branch }} version..."
141+
if [ -d ".github/workflows" ]; then
142+
git checkout ${{ matrix.target_branch }} -- .github/workflows/ || true
143+
fi
136144
137145
138146
# Stage all changes

test-sync-file.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Test file to demonstrate branch sync
2+
// This file is added to main and should be synced to net8
3+
namespace Test
4+
{
5+
public class TestSync
6+
{
7+
public string Message => "This change is from main branch";
8+
}
9+
}

0 commit comments

Comments
 (0)