Repository navigation
fix: actually enable auto-merge on update PRs - #87
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge. SummaryFixes update PRs silently skipping auto-merge.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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--jqprints an empty string for a JSONnull, unlikejq, which printsnull.auto_merge.shcompared theautoMergeRequestlookup against the string"null", so the check never matched andgh pr merge --autowas silently skipped on every run.Changes
actions/common/auto_merge.sh: askghfor.autoMergeRequest != null, which printstrueorfalse, and enable auto-merge unless it is alreadytrue.actions/common/test_auto_merge.sh: the fakeghused to return a hard-coded"null", which hid the bug. It now runs the script's real--jqexpression withjqagainst a sample PR JSON and prints null as an empty line, like realgh.Backwards-incompatible changes
None
Testing
bash actions/common/test_auto_merge.shpasses all 10 cases.auto_merge.shfails both "enables squash auto-merge" cases, so the tests now catch this bug.jq, which is preinstalled on GitHub's Ubuntu runners.AI usage
🤖 Generated with Claude Code
https://claude.ai/code/session_01LPLNEEPRsNpjrJ4vwxictq