Fix git-flow init failure: use feature/main-dummy as production branch#508
Merged
yogeswaransky merged 2 commits intoApr 12, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/rdkcentral/sysint/sessions/4029adcb-d3f4-4edf-9267-25d04f36d2a8 Co-authored-by: yogeswaransky <166126056+yogeswaransky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix component release workflow for gitflow branching
Fix git-flow init failure: use feature/main-dummy as production branch
Apr 12, 2026
yogeswaransky
approved these changes
Apr 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the component-release GitHub Actions workflow to successfully initialize git-flow by using distinct production and development branches, addressing the Fatal: Production and integration branches should differ. failure during releases.
Changes:
- Switch
gitflow.branch.mastertofeature/main-dummywhile keepinggitflow.branch.developasfeature/component-release. - Ensure
feature/main-dummyexists locally before runninggit flow init. - Push
feature/main-dummyaftergit flow release finishso the production-branch merge is published to the remote.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
97d93f0
into
feature/component-release
7 of 8 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
git flow initrequires distinct production and development branches — the workflow was setting bothgitflow.branch.masterandgitflow.branch.developtofeature/component-release, causingFatal: Production and integration branches should differ.Changes
gitflow.branch.master→feature/main-dummy(wasfeature/component-release)git flow init -d -f:git push origin feature/main-dummyso git-flow's merge back into the production branch is pushed to remoteOriginal prompt
Problem
The
component-release.ymlGitHub Actions workflow on thefeature/component-releasebranch fails with:This happens because both
gitflow.branch.masterandgitflow.branch.developare set tofeature/component-release, and git-flow requires these to be different branches.Required Fix
In
.github/workflows/component-release.yml, in the"Start release, generate changelog and publish"step, make the following changes:gitflow.branch.masterfromfeature/component-releasetofeature/main-dummy(a new branch that has been created for this purpose).gitflow.branch.developasfeature/component-release.git flow init -d -f, add a line to ensure thefeature/main-dummybranch exists locally:The config block should look like:
"Finish release and push"step to push both branches and tags:- name: Finish release and push run: | set -e git flow release finish -m "$RELEASE_VERSION release" "$RELEASE_VERSION" git push origin feature/component-release git push origin feature/main-dummy git push origin --tagsFile to modify
.github/workflows/component-release.yml(on branchfeature/component-release)The following is the prior conversation context from the user's chat exploration (may be truncated):
User: No version type found in PR description, defaulting to PATCH increment.
Using calculated version: 5.0.1
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
Error: Process completed with exit code 1.
go this error.
how to make the git flow run.
PS: dont worry about the "No version type found in PR description, defaulting to PATCH increment." message.
Assistant: The
component-release.ymlworkflow is not in this repo — it's likely a reusable workflow from another repository (likerdkcentral/build_tools_workflowsor similar). Let me check where the actual workflow is coming from.Assistant: ## Root Cause
The error is clear:
The "Component Release" workflow (
.github/workflows/component-release.yml) is using agit flow releasecommand (likelygit flow release startorgit flow release finish) to create release version5.0.1. However, the GitHub Actions runner checks out a fresh copy of the repo each time, and git-flow is not initialized in that fresh checkout.Why This Happens
git flow initcreates local configuration (stored in.git/config) that defines which branches map tomaster,develop,feature/,release/,hotfix/, etc. Since GitHub Actions runners start with a clean clone every time, this local configuration does not persist between runs.How to Fix
You need to add a
git flow initstep before the step that runs thegit flow releasecommand in your workflow. The workflow file iscomponent-release.yml— based on the logs, it appears to be a reusable/called workflow (possibly from another repo likerdkcentral/cmf-actionsor similar, since it's not directly visible inrdkcentral/sysint).Add something like this before the git flow release step:
The
-dflag accepts all default branch naming conventions automatically (no interactive prompts), which is essential for CI:master(ormain)developfeature/release/hotfix/If your repo uses
maininstead ofmasterIf the default production branch is
mainrather thanmaster, you'll need to specify it explicitly: