Skip to content

fix(ci): handle missing MERGE_HEAD in staging conflict check#7273

Merged
h0lybyte merged 1 commit intodevfrom
atom-02251239-mc-ci-staging-fix
Feb 25, 2026
Merged

fix(ci): handle missing MERGE_HEAD in staging conflict check#7273
h0lybyte merged 1 commit intodevfrom
atom-02251239-mc-ci-staging-fix

Conversation

@h0lybyte
Copy link
Member

Summary

  • Fix Validate Staging→Main PR / Lint and Test failing with fatal: There is no merge to abort (MERGE_HEAD missing) (exit code 128)
  • When staging already contains main, git merge --no-commit --no-ff origin/main returns "Already up to date" without creating a MERGE_HEAD. The subsequent git merge --abort then fails because there's nothing to abort.
  • Fix: fall back to git reset --hard HEAD when git merge --abort fails, covering both the success (no conflicts) and failure (conflicts) paths.

Test plan

When staging already contains main (Already up to date), git merge
--no-commit --no-ff succeeds without creating a MERGE_HEAD. The
subsequent git merge --abort then fails with exit code 128. Fall
back to git reset --hard HEAD when merge --abort fails.
@github-actions
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@h0lybyte h0lybyte merged commit 553f1cf into dev Feb 25, 2026
13 of 14 checks passed
@h0lybyte h0lybyte deleted the atom-02251239-mc-ci-staging-fix branch February 25, 2026 17:44
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