Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable continue on error for our mirror steps #7430

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions eng/pipelines/templates/steps/sync-repo-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ parameters:
steps:

- ${{ each repo in parameters.Repos }}:

- ${{ each target in repo.value.TargetRepos }}:

- task: PowerShell@2
displayName: Sync Repo from ${{ repo.key }} to ${{ target.key }}
continueOnError: true
inputs:
pwsh: true
workingDirectory: ${{ parameters.WorkingDirectory }}
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/sync-repo-merge-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ steps:

- task: PowerShell@2
displayName: Merge branch from ${{ repo.value.Branch }} into ${{ target.key }}
continueOnError: true
inputs:
pwsh: true
workingDirectory: ${{ parameters.WorkingDirectory }}/${{ repo.key }}
Expand Down Expand Up @@ -79,6 +80,7 @@ steps:
Write-Host "gh pr merge $mergeBranch --auto --merge --repo ${{ repo.key }}"
gh pr merge $mergeBranch --auto --merge --repo ${{ repo.key }}
displayName: Create Pull Request for merge
continueOnError: true
workingDirectory: ${{ parameters.WorkingDirectory }}/${{ repo.key }}
env:
GH_TOKEN: $(azuresdk-github-pat)
12 changes: 6 additions & 6 deletions eng/scripts/Merge-Branch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ if ($LASTEXITCODE -and -not $mergeOutput.EndsWith('Automatic merge failed; fix c

# update paths matching "theirs", except for "ours" and "merge", to the state in $SourceBranch
if ($Theirs.Length) {
Write-Verbose "git restore -s $SourceBranch --worktree --theirs -- $theirIncludes $ourExcludes $mergeExcludes"
git restore -s $SourceBranch --worktree --theirs -- $theirIncludes $ourExcludes $mergeExcludes
Write-Verbose "git restore -s $SourceBranch --worktree --ignore-unmerged -- $theirIncludes $ourExcludes $mergeExcludes"
git restore -s $SourceBranch --worktree --ignore-unmerged -- $theirIncludes $ourExcludes $mergeExcludes
if ($LASTEXITCODE) { ErrorExit $LASTEXITCODE }
Write-Verbose "git add -A"
git add -A
Expand All @@ -66,17 +66,17 @@ if ($Theirs.Length) {

# update paths matching "ours", except for "merge", to their pre-merge state
if ($Ours.Length) {
Write-Verbose "git restore -s (git rev-parse HEAD) --worktree --theirs -- $ourIncludes $mergeExcludes"
git restore -s (git rev-parse HEAD) --worktree --theirs -- $ourIncludes $mergeExcludes
Write-Verbose "git restore -s (git rev-parse HEAD) --worktree --ignore-unmerged -- $ourIncludes $mergeExcludes"
git restore -s (git rev-parse HEAD) --worktree --ignore-unmerged -- $ourIncludes $mergeExcludes
if ($LASTEXITCODE) { ErrorExit $LASTEXITCODE }
Write-Verbose "git add -A"
git add -A
if ($LASTEXITCODE) { ErrorExit $LASTEXITCODE }
}

if ($AcceptTheirsForFinalMerge) {
Write-Verbose "git restore -s $SourceBranch --worktree --theirs -- $mergeIncludes"
git restore -s $SourceBranch --worktree --theirs -- $mergeIncludes
Write-Verbose "git restore -s $SourceBranch --worktree --ignore-unmerged -- $mergeIncludes"
git restore -s $SourceBranch --worktree --ignore-unmerged -- $mergeIncludes
if ($LASTEXITCODE) { ErrorExit $LASTEXITCODE }
Write-Verbose "git add -A"
git add -A
Expand Down