Repository navigation
Automate release → develop sync via a "Sync release PR to develop" GitHub Action #2500
anushasunkada
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
In esignet's branching model, hotfixes and changes often land first on a
release**branch and then need to be manually reflected back into one or moredevelopbranches (e.g.develop,develop-go). Today this back-merge is a manual step:developbranch(es) a given release fix applies to.developto drift fromrelease) and slow.Proposed solution
Introduce a GitHub Actions workflow that triggers automatically whenever a PR into a
release**branch is merged, and:developbranch(es) it should be synced into.developbranch.developbranch automatically, carrying over the same label.This keeps a human in the loop only when there's an actual conflict, and fully automates the happy path.
Solution Details
Reference: https://github.com/Infosys/esignet/blob/task/auto-pr-raise/.github/workflows/auto-pr-raise.yml
Reference Sync PR: thunder-id/thunderid#5138
Trigger
Runs on any PR closed against a branch matching
release**, but the job itself is gated ongithub.event.pull_request.merged == trueso closed-without-merge PRs are skipped.Permissions
Needed to push the new sync branch and open/comment on PRs using the default
GITHUB_TOKEN— no extra PAT or secret required.Step-by-step flow
fetch-depth: 0) — required for cherry-pick to work.sync-to-develop→develop,sync-to-develop-go→develop-go). If no matching label is found, the rest of the job is skipped cleanly (no-op, not a failure).github-actions[bot]) for the commits/branch it creates.developbranch assync/pr-<number>-to-<develop_branch>.-m 1to pick the mainline parent) onto the new branch. On failure, aborts cleanly and recordssuccess=falserather than leaving a broken cherry-pick state.sync: <original title> (#<PR number>), with a body linking back to the source PR, and re-applies the matched label — only runs on success.Key design choices worth highlighting
GITHUB_TOKEN, so there's no extra secret-management burden for adopting repos.What would need to be adapted for esignet's
develop/develop-gosetuprelease**branch glob actually matches esignet's real release-branch naming convention.LABEL_TO_BRANCHmap with esignet's actual labels/branches (at minimumdevelopanddevelop-go; extend if there are more lines).sync-to-develop/sync-to-develop-go(or renamed equivalents) exist as repo labels, and decide whether they should be added manually per-PR or auto-applied based on some other signal (e.g. changed files/paths).All reactions