File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ jobs:
100100 # Check if branch exists remotely
101101 if git ls-remote --heads origin "$COMMIT_BRANCH" | grep -q "$COMMIT_BRANCH"; then
102102 echo "📥 Branch '$COMMIT_BRANCH' exists, checking out and merging with main..."
103- # Branch exists - fetch and checkout
103+ # Branch exists - stash new untracked files to avoid checkout conflict
104104 git fetch origin "$COMMIT_BRANCH"
105+ git stash push --include-untracked -m "temp: new sfs files before branch switch"
105106 git checkout "$COMMIT_BRANCH"
106107 # Merge latest main into fixed branch to keep it updated
107108 git merge origin/main --no-edit --strategy-option theirs || echo "Merge completed (conflicts auto-resolved)"
109+ # Restore the newly generated files
110+ git stash pop
108111 else
109112 echo "🆕 Branch '$COMMIT_BRANCH' doesn't exist, creating new..."
110113 # Branch doesn't exist - create new
You can’t perform that action at this time.
0 commit comments