Skip to content

Conversation

@miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented Dec 29, 2025

Overview

Fix duplicities in release draft workflow.

Release Notes

  • Enhance release draft workflow by adding infra-repo-ref input and refining tag creation process

Summary by CodeRabbit

  • Chores
    • Improved release workflow: revamped tag creation to produce annotated tags with metadata and ensure the new tag reference is created reliably.
    • Streamlined draft release step: standardized tag-name inputs, adjusted release naming and prerelease setting, and ensured inputs propagate correctly across steps.

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

@miroslavpojer miroslavpojer self-assigned this Dec 29, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

Walkthrough

Replaced lightweight tag creation with annotated tag creation (including message and tagger metadata), changed tag ref creation to use the annotated tag object's SHA, reconnected the draft-release step to use github.event.inputs.tag-name and set prerelease: false, and preserved token/env propagation between steps.

Changes

Cohort / File(s) Summary
GitHub Actions release workflow
.github/workflows/release_draft.yml
Replaced standalone lightweight tag step with annotated tag creation (message, tagger name/email/date), use tagObject.data.sha to create the tag ref, switched inputs to read core.getInput('tag-name') and github.event.inputs.tag-name, re-added draft release step with prerelease: false, and adjusted step naming and input wiring.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Runner as Actions Runner
  participant REST as GitHub REST API
  participant Repo as Git Data (refs/tags)

  Runner->>REST: create annotated tag (message, tagger metadata)
  REST-->>Runner: returns tagObject (with .data.sha)
  Runner->>REST: create ref using tagObject.data.sha -> refs/tags/{tag-name}
  Runner->>REST: create draft release with tag-name (prerelease: false)
  note right of REST `#DFF2E1`: Steps use token from workflow inputs/env
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • benedeki
  • lsulak
  • salamonpavel

Poem

🐰 I hopped through YAML, swift and spry,

I stitched a tag with name and why.
A SHA was born, a ref took flight,
The draft now waits — not prerelease tonight. 🏷️

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix rls draft workflow' is vague and uses an abbreviation ('rls') that lacks clarity about the specific issue being addressed. Expand the title to be more descriptive, such as 'Fix tag creation duplicities in release draft workflow' or similar, to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the Overview and Release Notes sections from the template, but the Related section with issue reference is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fix-release-draft-workflow

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.

@github-actions
Copy link

JaCoCo 'balta' module code coverage report - scala 2.12.18

Overall Project 67.11% 🍏

There is no coverage information present for the Files changed

@miroslavpojer miroslavpojer marked this pull request as ready for review December 29, 2025 10:10
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

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38581e7 and cb293cf.

📒 Files selected for processing (1)
  • .github/workflows/release_draft.yml
🔇 Additional comments (3)
.github/workflows/release_draft.yml (3)

134-134: LGTM: Explicit input reference improves clarity.

Using github.event.inputs.tag-name directly is more explicit and consistent with the tag_name field on line 136.


138-138: LGTM: Explicit prerelease flag improves clarity.

Explicitly setting prerelease: false documents the intended behavior and is a good practice, even if it matches the default value.


95-127: > Likely an incorrect or invalid review comment.

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: 0

🧹 Nitpick comments (1)
.github/workflows/release_draft.yml (1)

91-124: Annotated tag creation looks good; consider adding error handling.

The switch to annotated tags with proper metadata (message, tagger info) is a best practice for releases. The use of tagObject.data.sha at line 118 correctly creates a reference to the tag object rather than directly to the commit.

However, if createTag succeeds but createRef fails (e.g., network issue, race condition), an orphaned tag object will remain in the repository. Consider wrapping the two API calls in a try-catch and cleaning up on failure.

🔎 Suggested error handling pattern
         script: |
           const tag = core.getInput('tag-name')
           const ref = `refs/tags/${tag}`;
           const sha = context.sha; // The SHA of the commit to tag
           const tagMessage = `${tag} released by GitHub Action`;
+          
+          try {
+            const tagObject = await github.rest.git.createTag({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              tag: tag,
+              message: tagMessage,
+              object: sha,
+              type: 'commit',
+              tagger: {
+                name: context.actor,
+                email: `${context.actor}@users.noreply.github.com`,
+                date: new Date().toISOString()
+              }
+            });

-          const tagObject = await github.rest.git.createTag({
-            owner: context.repo.owner,
-            repo: context.repo.repo,
-            tag: tag,
-            message: tagMessage,
-            object: sha,
-            type: 'commit',
-            tagger: {
-              name: context.actor,
-              email: `${context.actor}@users.noreply.github.com`,
-              date: new Date().toISOString()
-            }
-          });

-          await github.rest.git.createRef({
-            owner: context.repo.owner,
-            repo: context.repo.repo,
-            ref: ref,
-            sha: tagObject.data.sha
-          });
+            await github.rest.git.createRef({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              ref: ref,
+              sha: tagObject.data.sha
+            });

-          console.log(`Tag created: ${tag}`);
+            console.log(`Tag created: ${tag}`);
+          } catch (error) {
+            core.setFailed(`Failed to create tag: ${error.message}`);
+            throw error;
+          }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb293cf and 38384f1.

📒 Files selected for processing (1)
  • .github/workflows/release_draft.yml
🔇 Additional comments (1)
.github/workflows/release_draft.yml (1)

130-134: LGTM! Draft release configuration is correct.

The draft release step correctly references the tag created in the previous step via github.event.inputs.tag-name, and setting prerelease: false is appropriate for this workflow.

@miroslavpojer miroslavpojer merged commit be63730 into master Dec 29, 2025
11 checks passed
@miroslavpojer miroslavpojer deleted the feature/fix-release-draft-workflow branch December 29, 2025 10:36
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