Skip to content

The inter branch merge workflow fails if there have been manual commits to the merge/ branch #16606

@rolfbjarne

Description

@rolfbjarne
  • This issue is blocking
  • This issue is causing unreasonable pain

The inter branch merge workflow fails to push changes if:

  • The merge/x-to-y branch already exists, and
  • There have been manual commits to the merge/x-to-y branch (for instance to fix merge conflicts).

Example: https://github.com/dotnet/macios/actions/runs/23258369412/job/67619700219

Log
Run D:\a\macios\macios\arcade-repository\.github\workflows\scripts\inter-branch-merge.ps1 -RepoName macios -RepoOwner dotnet -MergeFromBranch $env:GITHUB_REF_NAME -MergeToBranch net11.0 -ResetToTargetPaths "global.json;NuGet.config;eng/Version.Details.xml;eng/Version.Details.props;eng/common/*" -QuietComments
  D:\a\macios\macios\arcade-repository\.github\workflows\scripts\inter-branch-merge.ps1 -RepoName macios -RepoOwner dotnet -MergeFromBranch $env:GITHUB_REF_NAME -MergeToBranch net11.0 -ResetToTargetPaths "global.json;NuGet.config;eng/Version.Details.xml;eng/Version.Details.props;eng/common/*" -QuietComments
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    GH_TOKEN: ***
 & git fetch --quiet origin 
 & git checkout --quiet $MergeToBranch 
 & git reset --hard origin/$MergeToBranch 
HEAD is now at ce357dc9ea [net11.0] Update dependencies from dotnet/dotnet (#24916)
net11.0:		ce357dc9ea GitHub <noreply@github.com>: [net11.0] Update dependencies from dotnet/dotnet (#24916) (2 hours ago)
 & git checkout --quiet $MergeFromBranch 
 & git reset --quiet --hard origin/$MergeFromBranch 
main:	4077c4b708 GitHub <noreply@github.com>: [tests] Fix BitmapContextTest.CreateAdaptive_3/_4 crash due to undersized buffer (#24920) (10 minutes ago)
Merging:	4077c4b708 GitHub <noreply@github.com>: [tests] Fix BitmapContextTest.CreateAdaptive_3/_4 crash due to undersized buffer (#24920) (10 minutes ago)
Merging:	fcc6c07da2 GitHub <noreply@github.com>: LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20260317174730541 to main (#24912) (50 minutes ago)
Merging:	5dc7df44f6 GitHub <noreply@github.com>: [dotnet] Make 'dotnet watch' work. (#24922) (2 hours ago)
Merging:	4a99c2ee88 GitHub <noreply@github.com>: [main] Update dependencies from dotnet/dotnet (#24917) (2 hours ago)
Merging:	b427ce7eae GitHub <noreply@github.com>: [sharpie] Prefer standard protocol interfaces over [Model] classes in type mapping (#24913) (6 hours ago)
Merging:	310712acf2 GitHub <noreply@github.com>: LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20260318055049745 to main (#24918) (9 hours ago)
Merging:	d8dcb86f11 GitHub <noreply@github.com>: [Foundation] Improve nullability in NSArray.GetItem. (#24907) (22 hours ago)
Merging:	6b9cfc9a25 GitHub <noreply@github.com>: [msbuild] Filter static frameworks from post-processing items. Fixes #24840. (#24845) (22 hours ago)
Merging:	03b49189a7 GitHub <noreply@github.com>: [sharpie] Fix platform type mapping for types inside generic type arguments. Fixes #24892. (#24911) (25 hours ago)
Merging:	6ed4eb32c6 GitHub <noreply@github.com>: [tests] Detect when we couldn't create a second background session. (#24878) (25 hours ago)
Merging:	76cf49e6be GitHub <noreply@github.com>: [msbuild] Rename the localization resources, so they don't match localization resources from other assemblies. (#24899) (26 hours ago)
Merging:	095d77ff0e GitHub <noreply@github.com>: [tests] Fix flaky RecordTest.DeskCase_83099_InmutableDictionary on macOS CI (#24908) (26 hours ago)
Merging:	94e4aa79b2 GitHub <noreply@github.com>: [tests] Choose the right simulator RID on x64. (#24874) (29 hours ago)
Merging:	45549a4809 GitHub <noreply@github.com>: [build] Fix parallel make hang by disabling dotnet build servers (#24903) (29 hours ago)
Merging:	08716c75af GitHub <noreply@github.com>: [tools] There's no need to set the DOTNET variable before creating makefile fragments for csproj anymore. (#24890) (30 hours ago)
Merging:	75de7f3f9e GitHub <noreply@github.com>: [Foundation] Improve nullability in NSArray.ArrayFromHandleFunc. (#24900) (30 hours ago)
Merging:	539072289d GitHub <noreply@github.com>: [main] Update dependencies from dotnet/dotnet (#24905) (32 hours ago)
Merging:	1f573e7e57 GitHub <noreply@github.com>: [main] Update dependencies from dotnet/xharness (#24904) (33 hours ago)
Merging:	0a572b5b62 GitHub <noreply@github.com>: Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 13567384 (#24901) (33 hours ago)
Merging:	809b19e6a9 GitHub <noreply@github.com>: [src] Transient strings must always be disposed. (#24894) (2 days ago)
Merging:	cd5bbb0ee1 GitHub <noreply@github.com>: [GitHub Actions] Allow manual triggering of Linux Build Verification workflow (#24876) (2 days ago)
Merging:	44c872c893 GitHub <noreply@github.com>: [Foundation] Improve nullability in NSArray.FromArrayNative. (#24884) (2 days ago)
Merging:	bf6009ee75 GitHub <noreply@github.com>: [main] Update dependencies from dotnet/xharness (#24880) (2 days ago)
Merging:	95470ee0ba GitHub <noreply@github.com>: [sharpie] Add --deepsplit option to split bindings into one file per source header (#24883) (2 days ago)
Merging:	c568db92a8 GitHub <noreply@github.com>: [runtime] Make 'is_class_finalization_aware' work before the managed NSObject type has been loaded. (#24875) (2 days ago)
Merging:	59e6156e4a GitHub <noreply@github.com>: [main] Update dependencies from dotnet/dotnet (#24881) (2 days ago)
This PR merges commits made on main by the following committers:

* rolfbjarne
* csigs
* dotnet-maestro[bot]
* dalexsoto
* vs-mobiletools-engineering-service2
 & git checkout -B $mergeBranchName  
Switched to a new branch 'merge/main-to-net11.0'
Resetting files to net11.0 for patterns: global.json, NuGet.config, eng/Version.Details.xml, eng/Version.Details.props, eng/common/*
 & git config user.name "github-actions[bot]" 
 & git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 
Processing pattern: global.json
Checked out pattern 'global.json' from net11.0
Processing pattern: NuGet.config
Checked out pattern 'NuGet.config' from net11.0
Processing pattern: eng/Version.Details.xml
Checked out pattern 'eng/Version.Details.xml' from net11.0
Processing pattern: eng/Version.Details.props
Checked out pattern 'eng/Version.Details.props' from net11.0
Processing pattern: eng/common/*
Checked out pattern 'eng/common/*' from net11.0
 & git add -A 
 & git commit -m $commitMessage 
[merge/main-to-net11.0 27c8e25063] Reset files to net11.0
 31 files changed, 762 insertions(+), 471 deletions(-)
 create mode 100644 eng/common/core-templates/job/renovate.yml
 create mode 100644 eng/common/core-templates/stages/renovate.yml
 create mode 100644 eng/common/core-templates/steps/install-microbuild-impl.yml
 create mode 100644 eng/common/renovate.env
Successfully reset files to net11.0 for patterns: global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Version.Details.props
- eng/common/*
 & git push $remoteName "${mergeBranchName}:${mergeBranchName}" 
To https://github.com/dotnet/macios
 ! [rejected]              merge/main-to-net11.0 -> merge/main-to-net11.0 (non-fast-forward)
error: failed to push some refs to 'https://github.com/dotnet/macios'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
WARNING: Failed to update existing PR
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions