Skip to content

Commit ea8ae1c

Browse files
committed
Fix cask push: reset to origin/main before updating to avoid rebase conflicts
1 parent 56ca496 commit ea8ae1c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.azure-pipelines/templates/macos/macos-publish-jobs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ jobs:
182182
183183
cd $(Pipeline.Workspace)/homebrew-tap
184184
185+
# Always start from the latest origin/main to avoid rebase conflicts
186+
git fetch origin main
187+
git reset --hard origin/main
188+
185189
# Homebrew uses sharded cask layout: Casks/<first-letter>/<name>.rb
186190
CASK_DIR="Casks/a"
187191
mkdir -p "$CASK_DIR"
@@ -200,7 +204,6 @@ jobs:
200204
git config user.email "azure-pipeline@microsoft.com"
201205
git add "$CASK_DIR/azure-cli.rb"
202206
git commit -m "Update azure-cli to $VERSION" || echo "No changes"
203-
git pull --rebase origin main
204207
git push origin HEAD:main
205208
206209
echo "Homebrew cask updated successfully"

0 commit comments

Comments
 (0)