Skip to content

change the automated changelog workflow#256

Merged
f-leu merged 2 commits intomainfrom
update-automated-changelog
Jan 27, 2026
Merged

change the automated changelog workflow#256
f-leu merged 2 commits intomainfrom
update-automated-changelog

Conversation

@f-leu
Copy link
Contributor

@f-leu f-leu commented Jan 25, 2026

[Title]

📚 Description of Changes

Provide an overview of your changes and why they’re needed. Link to any related issues (e.g., "Fixes #123"). If your PR fixes a bug, resolves a feature request, or updates documentation, please explain how.

  • What Changed:
    (Describe the modifications, additions, or removals.)

  • Why This Change:
    (Explain the problem this PR addresses or the improvement it provides.)

  • Affected Components:
    (Which component does this change affect? - put x for all components)

  • Compose

  • K8s

  • Other (please specify)

❓ Motivation and Context

Why is this change required? What problem does it solve?

  • Context:
    (Provide background information or link to related discussions/issues.)

  • Relevant Tasks/Issues:
    (e.g., Fixes: #GitHub Issue)

🔍 Types of Changes

Indicate which type of changes your code introduces (check all that apply):

  • BUGFIX: Non-breaking fix for an issue.
  • NEW FEATURE: Non-breaking addition of functionality.
  • BREAKING CHANGE: Fix or feature that causes existing functionality to not work as expected.
  • ENHANCEMENT: Improvement to existing functionality.
  • CHORE: Changes that do not affect production (e.g., documentation, build tooling, CI).

🔬 QA / Verification Steps

Describe the steps a reviewer should take to verify your changes:

  1. (Step one: e.g., "Run make test to verify all tests pass.")
  2. (Step two: e.g., "Deploy to a Kind cluster with make create-kind && make deploy.")
  3. (Additional steps as needed.)

✅ Global Checklist

Please check all boxes that apply:

  • I have read and followed the CONTRIBUTING guidelines.
  • My code follows the code style of this project.
  • I have updated the documentation as needed.
  • I have added tests that cover my changes.
  • All new and existing tests have passed locally.
  • I have run this code in a local environment to verify functionality.
  • I have considered the security implications of this change.

Summary by CodeRabbit

  • Chores
    • Automated release workflow now opens a pull request for changelog updates (instead of committing directly), creating and pushing a dedicated branch.
    • PR creation uses authenticated CLI flow and will skip creating a duplicate if a changelog PR already exists.
    • Simplified push/retry logic by using the PR creation flow for review and validation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Replaces direct commit-and-push of CHANGELOG.md with creating a new branch, committing the changelog there, and opening a pull request to main via the GitHub CLI (gh), using GH_TOKEN and pull-requests permission; skips PR creation if one already exists.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/create-tag-and-exit.yml
Replaced commit-and-push-with-retry flow with creating a new branch (BRANCH_NAME), committing CHANGELOG.md, pushing the branch, and using gh pr create (with GH_TOKEN) to open a PR against main; added pull-requests permission and branch-existence/PR-existence checks.

Sequence Diagram(s)

sequenceDiagram
  participant Runner as GitHub Actions Runner
  participant Checkout as repo (git)
  participant GH as GitHub CLI (gh)
  participant API as GitHub API / Pull Requests

  Runner->>Checkout: Create new branch (BRANCH_NAME) & checkout
  Runner->>Checkout: Commit updated CHANGELOG.md
  Runner->>Checkout: Push branch to remote (uses GH_TOKEN)
  Runner->>GH: gh pr list --head BRANCH_NAME (check existing PR)
  alt PR exists
    GH->>API: query PRs (no-op)
    Runner->>Runner: Skip PR creation
  else PR does not exist
    Runner->>GH: gh pr create --title/--body --base main --head BRANCH_NAME
    GH->>API: create PR on repo
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

changelog:added

Suggested reviewers

  • dray92
  • Tzvonimir

Poem

🐰 I hopped a branch and wrote the log anew,
Pushed a tiny sprout and asked for review.
With GH CLI I nudged the PR to start,
A changelog blossom, plucked from my heart. 🌷

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The linked issue #123 'cluster snapshot enum name fix' is unrelated to the PR's actual changes in the automated changelog workflow and GitHub Actions configuration. Verify and link the correct issue(s) that define the requirements for the changelog workflow automation changes, or clarify if #123 is the intended scope.
Title check ❓ Inconclusive The title 'change the automated changelog workflow' is vague and generic, using non-specific language that doesn't convey the actual implementation details of the change. Provide a more descriptive title such as 'Replace push-based changelog update with GitHub PR creation' to clearly communicate the main change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Out of Scope Changes check ✅ Passed The PR modifies the changelog workflow and introduces GitHub CLI-based PR creation, which aligns with the stated objectives, with no apparent out-of-scope changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/create-tag-and-exit.yml:
- Around line 89-92: The branch creation and push steps are not idempotent:
change the git checkout and push logic so rerunning the workflow for the same
BRANCH_NAME won't fail; use git checkout -B (replace existing local branch)
instead of git checkout -b, and use git push --force-with-lease origin
"$BRANCH_NAME" to safely update the remote branch if it already exists while
protecting against unexpected remote updates; keep the BRANCH_NAME variable and
commit step (git commit -m "chore: update changelog for ${{
steps.version.outputs.tag }}") but ensure the commit is conditional or uses git
add/commit --allow-empty to avoid errors when nothing changed.
🧹 Nitpick comments (1)
.github/workflows/create-tag-and-exit.yml (1)

94-98: Consider handling existing PRs for idempotency.

If a PR from this branch already exists (from a previous partial run), gh pr create will fail. You could check for an existing PR first and skip creation, or use gh pr edit to update it.

Optional: Skip PR creation if one already exists
           git push --force-with-lease origin "$BRANCH_NAME"
 
+          # Check if PR already exists for this branch
+          EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --json number --jq '.[0].number' || echo "")
+          if [[ -n "$EXISTING_PR" ]]; then
+            echo "PR #$EXISTING_PR already exists for branch $BRANCH_NAME; skipping creation."
+            exit 0
+          fi
+
           gh pr create \
             --title "chore: update changelog for ${{ steps.version.outputs.tag }}" \
             --body "Automated changelog update for release ${{ steps.version.outputs.tag }}" \
             --base main \
             --head "$BRANCH_NAME"

@f-leu f-leu merged commit 4231dfa into main Jan 27, 2026
26 checks passed
@f-leu f-leu deleted the update-automated-changelog branch January 27, 2026 16:23
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.

3 participants