Skip to content

fix: pick merge method sync_branches actually allows - #321

Closed
MQ37 wants to merge 1 commit into
mainfrom
fix/sync-branches-merge-method
Closed

MQ37 wants to merge 1 commit into
mainfrom
fix/sync-branches-merge-method

Conversation

@MQ37

@MQ37 MQ37 commented Aug 27, 2026

Copy link
Copy Markdown

What

sync_branches.yaml's merge step now reads the repo's allowed merge
methods (allow_merge_commit/allow_squash_merge/allow_rebase_merge)
and passes the first available as merge_method, preferring merge so
existing callers see no behavior change.

Why

pulls.merge() defaults to a merge commit. On any repo configured to
disallow merge commits the API 405s with "Merge commits are not allowed
on this repository", and the sync job fails outright — no PR ever gets
merged, so the branches drift.

Hit in apify/apify-ai-agent: apify/apify-ai-agent#81 failed on this,
went stale/conflicting, worked around manually in
apify/apify-ai-agent#82.

Testing

No test harness covers the embedded github-script block. Verified the
script is syntactically valid (node --check) and diffed the change
down to a 15-line, backward-compatible addition.

pulls.merge() defaults to a merge commit, which 405s
("Merge commits are not allowed on this repository") on any repo
configured to disallow them, e.g. apify/apify-ai-agent. Read the
repo's allowed merge methods and pick the first available, merge
preferred so unaffected callers keep today's behavior.
@github-actions github-actions Bot added the t-ai Issues owned by the AI team. label Aug 27, 2026
@MQ37 MQ37 closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants