Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/reusable-sync-from-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ jobs:
return 0
}

# git restore refuses unmerged paths, so on the conflict path it left conflicted
# workflows (markers included) and new upstream workflows in the commit.
keep_private_workflows() {
git rm -r -q -f --ignore-unmatch -- .github/workflows/
git checkout HEAD -- .github/workflows/
}

sync_branch() {
local branch="$1"

Expand Down Expand Up @@ -194,7 +201,7 @@ jobs:

# Merge source changes while retaining the private repo's reviewed workflows.
if git merge "public/$branch" --no-commit --no-ff; then
git restore --source=HEAD --staged --worktree -- .github/workflows/
keep_private_workflows
git commit -m "chore: sync $branch with public/$branch"
if git push origin "$branch"; then
echo "✅ $branch synced successfully"
Expand Down Expand Up @@ -228,7 +235,7 @@ jobs:
git checkout -b "$conflict_branch"

git merge "public/$branch" --no-commit --no-ff || true
git restore --source=HEAD --staged --worktree -- .github/workflows/
keep_private_workflows
git add -A
git commit -m "chore: sync $branch with public/$branch (conflicts present)

Expand Down
Loading