Skip to content

fix: checkout existing release branch in release workflow - #338

Merged
philbrookes merged 1 commit into
Kuadrant:mainfrom
philbrookes:fix-release-branch-checkout
Jul 13, 2026
Merged

fix: checkout existing release branch in release workflow#338
philbrookes merged 1 commit into
Kuadrant:mainfrom
philbrookes:fix-release-branch-checkout

Conversation

@philbrookes

@philbrookes philbrookes commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix release workflow failing when the release branch already exists on origin (e.g. patch releases like v0.25.2)
  • Check for the remote branch first and fetch/checkout it if present, otherwise create a new one

Problem

The release workflow unconditionally ran git checkout -b <release-branch>, which created a new local branch from the checked-out gitRef. When the release branch already existed on origin (from a previous release), the subsequent git push was rejected because the local branch diverged from the remote.

See: https://github.com/Kuadrant/authorino-operator/actions/runs/29233186429/job/86761778828

Summary by CodeRabbit

  • Bug Fixes
    • Improved release creation workflows by reliably checking out existing release branches or creating new ones when needed.
    • Increased consistency for subsequent release preparation and publishing steps.

The release workflow always created a new local branch, which failed
when the release branch already existed on origin (e.g. patch releases).
Check for the remote branch first and fetch/checkout it if present.

Signed-off-by: Phil Brookes <pbrookes@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow now checks out an existing remote release branch when available and creates a new branch otherwise, before continuing with release preparation and publication.

Changes

Release branch flow

Layer / File(s) Summary
Conditional release branch selection
.github/workflows/release.yaml
The workflow fetches and checks out an existing release branch from origin, or creates it when the branch does not exist.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

I’m a rabbit with branches to spare,
Fetching old ones with care.
If none can be found,
A new branch is spun round—
Releases hop smoothly from there.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: the release workflow now checks out an existing release branch instead of always creating one.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@philbrookes
philbrookes added this pull request to the merge queue Jul 13, 2026
Merged via the queue into Kuadrant:main with commit 90529ab Jul 13, 2026
11 of 15 checks passed
@philbrookes
philbrookes deleted the fix-release-branch-checkout branch July 13, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants