Skip to content

Fix component-release workflow: remove intermediate release branch push blocked by repo rulesets#509

Merged
yogeswaransky merged 2 commits into
feature/component-releasefrom
copilot/fix-component-release-workflow-again
Apr 12, 2026
Merged

Fix component-release workflow: remove intermediate release branch push blocked by repo rulesets#509
yogeswaransky merged 2 commits into
feature/component-releasefrom
copilot/fix-component-release-workflow-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

git flow release publish was pushing the intermediate release/X.Y.Z branch to remote, which repo rulesets block with GH013: 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

  • Removed git flow release publish from the release step — no need to push the transient release branch to remote
  • Merged "Finish release and push" step into the main stepgit flow release finish now runs in the same shell context where RELEASE_VERSION is set, eliminating the cross-step env var dependency
  • Renamed step to "Create release, generate changelog and push" to reflect actual behavior

Result

git flow release start "$RELEASE_VERSION"
auto-changelog -v "$RELEASE_VERSION"
git add CHANGELOG.md
git commit -m "$RELEASE_VERSION release changelog updates"

# Finish release locally (no need to publish to remote)
git flow release finish -m "$RELEASE_VERSION release" "$RELEASE_VERSION"

# Push results
git push origin feature/component-release
git push origin feature/main-dummy
git push origin --tags

release/X.Y.Z is created, used, and merged entirely on the runner — only the final merged state of feature/component-release, feature/main-dummy, and the annotated tag are pushed.

Original prompt

Problem

The component-release.yml GitHub Actions workflow on the feature/component-release branch fails because git flow release publish tries to push the intermediate release/5.0.1 branch to the remote, which is blocked by repository rulesets:

remote: error: GH013: Repository rule violations found for refs/heads/release/5.0.1.
remote: - Cannot create ref due to creations being restricted.

git flow release publish is 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:

  1. Remove the git flow release publish line from the "Start release, generate changelog and publish" step (it's the last line in that step's run block).

  2. 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's run: block should look like this (after the git flow release start, changelog generation, and commit):

          git flow release start "$RELEASE_VERSION"
          auto-changelog -v "$RELEASE_VERSION"
          git add CHANGELOG.md
          git commit -m "$RELEASE_VERSION release changelog updates"

          # Finish release locally (no need to publish to remote)
          git flow release finish -m "$RELEASE_VERSION release" "$RELEASE_VERSION"

          # Push results
          git push origin feature/component-release
          git push origin feature/main-dummy
          git push origin --tags
  1. Remove the separate "Finish release and push" step entirely since it's now merged into the previous step.

  2. Keep the "Cleanup tag if workflow fails" step as-is.

  3. 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 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
 ...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

…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
Copilot AI requested a review from yogeswaransky April 12, 2026 09:12
@yogeswaransky yogeswaransky marked this pull request as ready for review April 12, 2026 09:40
@yogeswaransky yogeswaransky requested a review from a team as a code owner April 12, 2026 09:40
Copilot AI review requested due to automatic review settings April 12, 2026 09:40
@yogeswaransky yogeswaransky merged commit cf43fd2 into feature/component-release Apr 12, 2026
2 of 4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 12, 2026
Copilot AI requested a review from yogeswaransky April 12, 2026 09:40
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