Skip to content

fix: actually enable auto-merge on update PRs - #87

Merged
blink1073 merged 1 commit into
Calysto:mainfrom
blink1073:fix-auto-merge
Oct 21, 2026
Merged

blink1073 merged 1 commit into
Calysto:mainfrom
blink1073:fix-auto-merge

Conversation

@blink1073

Copy link
Copy Markdown
Contributor

References

Fixes the auto-merge step added in #82. Seen in blink1073/oct2py#480 (run https://github.com/blink1073/oct2py/actions/runs/39207992409/job/117914908753): the PR was approved but auto-merge was never enabled, and the job still succeeded.

Description

gh's built-in --jq prints an empty string for a JSON null, unlike jq, which prints null. auto_merge.sh compared the autoMergeRequest lookup against the string "null", so the check never matched and gh pr merge --auto was silently skipped on every run.

Changes

  • actions/common/auto_merge.sh: ask gh for .autoMergeRequest != null, which prints true or false, and enable auto-merge unless it is already true.
  • actions/common/test_auto_merge.sh: the fake gh used to return a hard-coded "null", which hid the bug. It now runs the script's real --jq expression with jq against a sample PR JSON and prints null as an empty line, like real gh.

Backwards-incompatible changes

None

Testing

  • bash actions/common/test_auto_merge.sh passes all 10 cases.
  • Running the updated tests against the old auto_merge.sh fails both "enables squash auto-merge" cases, so the tests now catch this bug.
  • The test needs jq, which is preinstalled on GitHub's Ubuntu runners.

AI usage

  • Some or all of the content of this PR was generated by AI.
  • The human author has carefully reviewed this PR and run this code.
  • AI tools and models used: Claude Opus 5.5 (Claude Code)

🤖 Generated with Claude Code

https://claude.ai/code/session_01LPLNEEPRsNpjrJ4vwxictq

@blink1073 blink1073 added the bug Something isn't working label Oct 21, 2026
@blink1073
blink1073 enabled auto-merge (squash) October 21, 2026 02:53
@blink1073
blink1073 merged commit 853b8d4 into Calysto:main Oct 21, 2026
28 checks passed
@blink1073
blink1073 deleted the fix-auto-merge branch October 21, 2026 02:55
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes update PRs silently skipping auto-merge.

  • Update pull requests enable auto-merge when no request exists.

No actionable issues found. Tests were inspected but not run.

Reviews (1) · Last reviewed commit: "fix: actually enable auto-merge on updat..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant