lnd
lnd copied to clipboard
Backport workflow
Summary
This PR introduces an automated backport workflow that simplifies backporting merged PRs from master to release
branches.
How It Works
- Merge a PR to master (or have it already merged)
- Add a backport label in format:
backport-v<version>-branch- Example:
backport-v0.20.x-branch
- Example:
- Workflow automatically:
- Validates the target branch exists
- Cherry-picks commits to a new branch
- Creates a PR targeting the release branch
- Adds
no-changeloglabel (release notes already in master PR)
Key Features
- Label-driven: Just add
backport-v0.20.x-branchto trigger - Branch validation: Fails fast if target branch doesn't exist
- Multiple backports: Add multiple labels to backport to several branches simultaneously
- Conflict handling: Creates draft PR with conflict markers for manual resolution
- Skip merge commits: Only cherry-picks actual changes, ignores sync merges
- No manual work: Eliminates manual branch creation, cherry-picking, and PR creation
Example Usage
PR #1234 merged with label: backport-v0.20.x-branch
→ Workflow creates PR #1235 Title: [v0.20.x-branch] Backport #1234: Original Title Base: v0.20.x-branch Labels: no-changelog Status: Ready for review (or Draft if conflicts)
Documentation
- Detailed guide: docs/backport-workflow.md
- Contributing: docs/code_contribution_guidelines.md
Verified the whole behaviour on my local repo, so take a look at if you wanna see how the created backports work:
https://github.com/ziggie1984/lnd/pulls
Created a PR which had 2 backport labels set, and also a PR which had a conflict.
/gemini review