.github: add generic automerge script with dry-run support - #209
Open
lumachad wants to merge 2 commits into
Open
.github: add generic automerge script with dry-run support#209lumachad wants to merge 2 commits into
lumachad wants to merge 2 commits into
Conversation
lumachad
force-pushed
the
users/lumachad/automerge_2
branch
3 times, most recently
from
July 20, 2026 11:47
848c3fb to
9dfe6b8
Compare
lumachad
force-pushed
the
users/lumachad/automerge_2
branch
from
July 20, 2026 12:18
9dfe6b8 to
b709061
Compare
lumachad
marked this pull request as ready for review
July 20, 2026 12:18
Make the script fully generic by reading the repo slug, target branch, and upstream branch from required environment variables (GITHUB_REPOSITORY, AUTOMERGE_TARGET_BRANCH, AUTOMERGE_UPSTREAM_BRANCH) instead of hardcoding them. Push conflict-free branches by direct refspec to avoid local merge commits. Add --dry-run mode that fetches and probes normally but skips all pushes and PR creation, printing what it would do instead. Wire it to a boolean workflow_dispatch input in the YAML. Use "conflict-free" instead of "fast-forward" throughout: the script merges (not pointer-advances), so "fast-forward" was misleading. Rename branch prefix, label constant, functions, and all user-visible strings accordingly; the merge-testing label value is unchanged.
Remove the if: false guard and enable the job. The pull_request trigger fires on any closed PR; the job condition narrows it to PRs that were merged into AUTOMERGE_TARGET_BRANCH and carry the merge-testing or merge-conflict label. Co-Authored-By: Claude <noreply@anthropic.com>
lumachad
force-pushed
the
users/lumachad/automerge_2
branch
from
July 21, 2026 16:12
b709061 to
a281154
Compare
Collaborator
Author
|
Updated to do a general FF -> conflict-free merge renaming. |
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.
Summary
AUTOMERGE_TARGET_BRANCH,AUTOMERGE_UPSTREAM_BRANCH) instead of being hardcoded. The script exits with an error if any are unset.--dry-runmode: fetches and probes normally but skips all pushes and PR creation, printing what it would do instead (branch name, commit range, PR title, and conflicted files if applicable).--dry-runto a booleanworkflow_dispatchinput so it can be toggled from the Actions UI.if: falseguard and re-enable the schedule andpull_requesttriggers. Thepull_requestcondition narrows to PRs merged intoAUTOMERGE_TARGET_BRANCHcarrying themerge-testingormerge-conflictlabel.Repository variables required
AUTOMERGE_TARGET_BRANCH— branch to merge into (e.g.amd-staging)AUTOMERGE_UPSTREAM_BRANCH— upstream branch to pull from (e.g.master)Test plan
origin/masteris updated and a conflict-free or conflict PR is opened