fix(steps/git): force-push auto-branch on every CheckoutMerged.progress()

The 'remote_branch_name is None' guard made auto-branch push
opt-in, not opt-out. When the merge commit already matched an
existing remote-tracking ref (e.g. a feat/* branch the workflow
was built on), brencher would skip the push and trigger the
workflow on whatever branch happened to point at the merge commit.
That branch is rarely the one the workflow is configured to watch,
so the workflow would 404 or stay silent.

Make auto-branch push unconditional when push=True: every cycle
where brencher detects a new HEAD in its watched remotes gets a
fresh 'auto-<short-sha>' branch on the origin remote, which the
workflow trigger (on push to 'auto-*') picks up. The earlier
'remote_branch_name' lookup is kept so the returned value is
useful for diagnostics, but no longer gates the push.
This commit is contained in:
hermes
2026-09-20 17:44:33 +00:00
parent e34ab51ad4
commit d9e87a7d26
+1 -1
View File
@@ -312,7 +312,7 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]):
remote_name, branch_name = ref.name.split('/', 1)
remote_branch_name = branch_name if remote_name == 'origin' else ref.name
break
if self.push and remote_branch_name is None:
if self.push:
auto_branch_hash = hashlib.sha1(''.join([x.hexsha for x in sorted_commits]).encode()).hexdigest()
auto_branch_name = f"auto-{version}"