Fix component-release workflow: remove intermediate release branch push blocked by repo rulesets#509
Merged
yogeswaransky merged 2 commits intoApr 12, 2026
Conversation
…e finish step Agent-Logs-Url: https://github.com/rdkcentral/sysint/sessions/85b51455-7329-4fa7-9f42-134b8782d4b0 Co-authored-by: yogeswaransky <166126056+yogeswaransky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix component release workflow to avoid unnecessary branch push
Fix component-release workflow: remove intermediate release branch push blocked by repo rulesets
Apr 12, 2026
yogeswaransky
approved these changes
Apr 12, 2026
cf43fd2
into
feature/component-release
2 of 4 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 release publishwas pushing the intermediaterelease/X.Y.Zbranch to remote, which repo rulesets block withGH013: Cannot create ref due to creations being restricted. Since the release is started and finished in the same CI run, the release branch only needs to exist locally.Changes
git flow release publishfrom the release step — no need to push the transient release branch to remote"Finish release and push"step into the main step —git flow release finishnow runs in the same shell context whereRELEASE_VERSIONis set, eliminating the cross-step env var dependency"Create release, generate changelog and push"to reflect actual behaviorResult
release/X.Y.Zis created, used, and merged entirely on the runner — only the final merged state offeature/component-release,feature/main-dummy, and the annotated tag are pushed.Original prompt
Problem
The
component-release.ymlGitHub Actions workflow on thefeature/component-releasebranch fails becausegit flow release publishtries to push the intermediaterelease/5.0.1branch to the remote, which is blocked by repository rulesets:git flow release publishis unnecessary in a CI workflow where the release is started and finished in the same run. The release branch only needs to exist locally.Required Fix
In
.github/workflows/component-release.yml:Remove the
git flow release publishline from the"Start release, generate changelog and publish"step (it's the last line in that step's run block).Remove the entire separate
"Finish release and push"step and instead add the finish and push commands at the end of the"Start release, generate changelog and publish"step.The end of the
"Start release, generate changelog and publish"step'srun:block should look like this (after thegit flow release start, changelog generation, and commit):Remove the separate
"Finish release and push"step entirely since it's now merged into the previous step.Keep the
"Cleanup tag if workflow fails"step as-is.Consider renaming the step from
"Start release, generate changelog and publish"to"Create release, generate changelog and push"since we're no longer publishing.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: