Skip to content

fix: sync develop through a pull request, not a direct push - #373

Merged
neuromechanist merged 2 commits into
developfrom
fix/issue-372-sync-via-pr
Sep 17, 2026
Merged

neuromechanist merged 2 commits into
developfrom
fix/issue-372-sync-via-pr

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #372.

Why

sync-develop.yml merges main into develop after a release and pushes. The push is rejected:

remote: error: GH013: Repository rule violations found for refs/heads/develop.
remote: - 2 of 2 required status checks are expected.
! [remote rejected] develop -> develop (push declined due to repository rule violations)

A ruleset on develop requires status checks, so a direct push cannot succeed no matter what the token is allowed to do. The workflow has therefore failed on every release since that ruleset was added, and develop fell quietly behind main each time. Observed again on run 35165312757, after v0.8.9.

That is one of two reasons the branches drift. The other is that this workflow only fires after a stable release tag, so a277f08 ("docs: add Code of Conduct and Contributing guide"), committed straight to main with no tag, never reached develop at all. The two together meant git diff main..develop showed both community documents as deletions, and merging develop into main would have removed them from the public repository. #358 caught it by hand before v0.8.9; nothing automatic would have.

What

The final step opens a pull request and enables auto-merge instead of pushing.

  • The merge and version bump still happen exactly as before; only how they land changes.
  • The sync branch is chore/sync-develop-after-v<version>, pushed with --force-with-lease.
  • An already-open pull request for that branch is reused rather than failing on a duplicate, because the tag workflow can fire more than once and an earlier failed attempt may have opened one.
  • Auto-merge uses --merge, not --squash: a squash would leave git unaware that main's commits are ancestors of develop, which is the drift this is meant to end.
  • If auto-merge cannot be enabled, the step emits a warning and leaves the pull request open rather than failing silently.

The comment claiming CI_ADMIN_TOKEN exists to push past branch protection is corrected: the token pushes the branch and opens the pull request, and deliberately does not bypass the ruleset. The pull request faces the same checks as any other change to develop, which was the point of the ruleset.

What this does not fix

A commit made directly to main with no release tag still bypasses the sync entirely, because the trigger is workflow_run on Tag and Release. Worth a scheduled check that fails when main..develop contains deletions; that catches both causes and does not depend on the release path. Left out of this change deliberately, so the fix stays reviewable.

Test

actionlint clean. The YAML parses and the job still has its nine steps in order. The final step's shell body extracted and checked with bash -n: syntax OK. The generated pull request body was inspected after block-scalar dedent and renders without leading whitespace.

It cannot be exercised end to end before merging, since it only runs on a real release tag. #371 performs this release's sync by hand in the meantime, so develop is not left behind while this lands.

@neuromechanist
neuromechanist merged commit d41c2f3 into develop Sep 17, 2026
6 checks passed
@neuromechanist
neuromechanist deleted the fix/issue-372-sync-via-pr branch September 17, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant