Skip to content

fix: initialize git-flow before release start in component-release workflow#506

Merged
yogeswaransky merged 2 commits into
feature/component-releasefrom
copilot/fix-gitflow-init-workflow
Apr 11, 2026
Merged

fix: initialize git-flow before release start in component-release workflow#506
yogeswaransky merged 2 commits into
feature/component-releasefrom
copilot/fix-gitflow-init-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Setting git config gitflow.* values alone doesn't satisfy git-flow's internal initialization check — git flow release start fails with Fatal: Not a gitflow-enabled repo yet on every fresh CI checkout.

Change

Added git flow init -d -f immediately after the gitflow config block, before git flow release start:

git config gitflow.prefix.versiontag ''

# Initialize git-flow (required for git flow commands to work)
git flow init -d -f

# Extract top tag from CHANGELOG.md
  • -d uses defaults, respecting the already-set config values
  • -f forces reinitialization even if partial config exists
Original prompt

Problem

The component-release.yml GitHub Actions workflow fails with:

Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
Error: Process completed with exit code 1.

The workflow at .github/workflows/component-release.yml on the feature/component-release branch sets gitflow config values manually (lines 56-62), but never actually runs git flow init. Setting git 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, add git flow init -d -f after the gitflow config block and before git flow release start. The -d flag uses defaults (which will respect the already-set config values), and -f forces 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 -f

This line must be placed before the # Extract top tag from CHANGELOG.md comment. No other changes are needed.

File to modify

  • .github/workflows/component-release.yml (on branch feature/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.yml workflow is not in this repo — it's likely a reusable workflow from another repository (like rdkcentral/build_tools_workflows or similar). Let me check where the actual workflow is coming from.

Assistant: ## Root Cause

The error is clear:

Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.

The "Component Release" workflow (.github/workflows/component-release.yml) is using a git flow release command (likely git flow release start or git flow release finish) to create release version 5.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 init creates local configuration (stored in .git/config) that defines which branches map to master, 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 init step before the step that runs the git flow release command in your workflow. The workflow file is component-release.yml — based on the logs, it appears to be a reusable/called workflow (possibly from another repo like rdkcentral/cmf-actions or similar, since it's not directly visible in rdkcentral/sysint).

Add something like this before the git flow release step:

- name: Initialize git flow
  run: |
    git flow init -d

The -d flag accepts all default branch naming conventions automatically (no interactive prompts), which is essential for CI:

  • Production branch: master (or main)
  • Development branch: develop
  • Feature prefix: feature/
  • Release prefix: release/
  • Hotfix prefix: hotfix/

If your repo uses main instead of master

If the default production branch is main rather than master, you'll need to specify it explicitly:

- name: Initialize git flow
  run: |
    git flow init -d -p main

Or use the full non-interactive config approach:

- name: Initialize git flow
  run: |
    git config gitflow.branch.master main
    git config gitflow.branch.develop develop
    git config gitflow.prefix.feature feature/
    git config gitflow.prefix.release release/
    git config gitflow.prefix.hotfix hotfix/
    git config gitflow.prefix.support support/
    git config gitflow.prefix.versiontag ""

Also ensure git-flow is installed

The default GitHub Actions ubuntu-latest runner has git-flow available, but if you're using a custom runner, you may need:

- name: Install git-flow
  run: sudo apt-get install -y git-flow

Next Steps

Since the `compone...

This pull request was created from Copilot chat.

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
Copilot AI requested a review from yogeswaransky April 11, 2026 17:17
@yogeswaransky yogeswaransky marked this pull request as ready for review April 11, 2026 17:17
@yogeswaransky yogeswaransky requested a review from a team as a code owner April 11, 2026 17:17
Copilot AI review requested due to automatic review settings April 11, 2026 17:17
@yogeswaransky yogeswaransky merged commit 61603c3 into feature/component-release Apr 11, 2026
2 of 3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants