-
Notifications
You must be signed in to change notification settings - Fork 0
fix: semantic-release backmerge fails with non-fast-forward when develop has diverged from main #202
Description
Affected Workflow
Release & Versioning (release, self-release, gptchangelog)
Workflow Version / Ref
Bug Description
The @saithodev/semantic-release-backmerge plugin used in the release workflow fails when develop has commits that diverge from main. After a successful release (tag + publish), the backmerge step attempts git push HEAD:develop which is rejected as non-fast-forward.
This was triggered by a hotfix on main for plugin-auth — the .dockerignore was already fixed in develop (removing init/ from ignore list), but the hotfix patch on main created a divergent history that can't be fast-forwarded.
Steps to Reproduce
- Have
developbranch ahead ofmainwith different commits (e.g. a fix already applied independently) - Merge a hotfix PR into
main - Release workflow triggers, semantic-release creates the tag successfully
- Backmerge step fails trying to push
HEAD:develop
Caller workflow: standard release workflow from shared-workflows.
Trigger: merge to main (hotfix PR #480)
Expected Behavior
The backmerge step should handle non-fast-forward scenarios gracefully — either by performing a merge commit, rebasing, or at minimum not failing the entire release pipeline after the tag/release was already created successfully.
Relevant Logs / Error Output
Command failed with exit code 1: git push https://x-access-token:[secure]@github.com/LerianStudio/plugin-auth HEAD:develop
! [rejected] HEAD -> develop (non-fast-forward)
error: failed to push some refs to 'https://github.com/LerianStudio/plugin-auth'
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.Failed run: https://github.com/LerianStudio/plugin-auth/actions/runs/24034388739/job/70090259275
Caller Workflow Configuration
# Standard shared release workflow invocation from plugin-auth
# Backmerge plugin: @saithodev/semantic-release-backmergeRunner OS
Self-hosted
Checklist
- I searched existing issues and this is not a duplicate.
- I am using a supported version/ref of the workflow.
- I have included relevant logs and configuration above.
Additional Context
Original card: #devops-team thread — Ferreira flagged the build failure on plugin-auth 2.5.0 release. Bedatty diagnosed the root cause as the .dockerignore excluding init/ directory on main (already fixed in develop). The hotfix PR was merged but the backmerge step broke due to branch divergence.
This is a systemic issue — any hotfix workflow where develop has independent commits will hit this.