fix: initialize git-flow before release start in component-release workflow#506
Merged
yogeswaransky merged 2 commits intoApr 11, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/rdkcentral/sysint/sessions/96115d8d-1c4b-40ef-85aa-0edaa5eccd8a Co-authored-by: yogeswaransky <166126056+yogeswaransky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GitHub Actions workflow by adding git flow init
fix: initialize git-flow before release start in component-release workflow
Apr 11, 2026
yogeswaransky
approved these changes
Apr 11, 2026
61603c3
into
feature/component-release
2 of 3 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.
Setting
git config gitflow.*values alone doesn't satisfy git-flow's internal initialization check —git flow release startfails withFatal: Not a gitflow-enabled repo yeton every fresh CI checkout.Change
Added
git flow init -d -fimmediately after the gitflow config block, beforegit flow release start:-duses defaults, respecting the already-set config values-fforces reinitialization even if partial config existsOriginal prompt
Problem
The
component-release.ymlGitHub Actions workflow fails with:The workflow at
.github/workflows/component-release.ymlon thefeature/component-releasebranch sets gitflow config values manually (lines 56-62), but never actually runsgit flow init. Settinggit config gitflow.*values alone is not sufficient — git-flow requires formal initialization to consider the repo "gitflow-enabled."Required Fix
In the
"Start release, generate changelog and publish"step, addgit flow init -d -fafter the gitflow config block and beforegit flow release start. The-dflag uses defaults (which will respect the already-set config values), and-fforces reinitialization even if partial config exists.Specifically, after this block:
git config gitflow.branch.master feature/component-release git config gitflow.branch.develop feature/component-release git config gitflow.prefix.feature feature/ git config gitflow.prefix.bugfix bugfix/ git config gitflow.prefix.release release/ git config gitflow.prefix.hotfix hotfix/ git config gitflow.prefix.support support/ git config gitflow.prefix.versiontag ''Add:
# Initialize git-flow (required for git flow commands to work) git flow init -d -fThis line must be placed before the
# Extract top tag from CHANGELOG.mdcomment. No other changes are needed.File 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:Or use the full non-interactive config approach:
Also ensure git-flow is installed
The default GitHub Actions
ubuntu-latestrunner hasgit-flowavailable, but if you're using a custom runner, you may need:Next Steps
Since the `compone...
This pull request was created from Copilot chat.