Port sync-branches as a composite action#11
Open
roborourke wants to merge 1 commit intomainfrom
Open
Conversation
Brings humanmade/sync-branches into this repo as a bash/composite action (.github/actions/sync-branches) using the gh CLI, matching the conventions of all other actions here. The JS runtime (node12, long deprecated) is replaced with a single shell step — no dist/ or npm dependencies required. Behaviour is preserved verbatim: removes the triggering label, fails with a PR comment if the sync branch already exists, creates the branch at the source PR's head SHA, opens the sync PR against the target branch, and assigns it to the original PR author. The token input now defaults to github.token so callers only need to override when a PAT is required. Also adds .gitignore to exclude .worktrees/ from git tracking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
.github/actions/sync-branches/action.yml— a composite/bash action that portshumanmade/sync-branches, replacing the deprecated node12 JS action with aghCLI shell step that matches the conventions of every other action in this repo (nodist/, no npm dependencies).github/actions/sync-branches/README.md— per-action docs with a usage example and notes on pairing withresolve-composer-lock-conflict.gitignore— ignores.worktrees/so local worktrees don't appear as untracked filesREADME.mdto include both the newsync-branchesand the in-flightresolve-composer-lock-conflictaction entriesBehaviour preserved verbatim from the upstream JS:
What's changed vs upstream:
snake_caseto match this repo's convention (from_branch,to_branch, etc.)github_tokendefaults to${{ github.token }}— callers only need to pass it when they need a PATgh api/gh prrather than@actions/githubOctokitdist/— the step is a single inline bash scriptNote
After this PR merges, consumers should migrate from
humanmade/sync-branches@mastertohumanmade/hm-github-actions/.github/actions/sync-branches@<SHA>and update input names to snake_case.Test plan
{source}-devbranch and sync PR are created, label is removed, and the sync PR is assigned to the original authorpull_request_is_draft: "true"— confirm the sync PR is opened as a draft🤖 Generated with Claude Code