-
Notifications
You must be signed in to change notification settings - Fork 1
Fix rls draft workflow #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ining tag creation process
WalkthroughReplaced 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 Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
JaCoCo 'balta' module code coverage report - scala 2.12.18
|
There was a problem hiding this 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
📒 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-namedirectly is more explicit and consistent with thetag_namefield on line 136.
138-138: LGTM: Explicit prerelease flag improves clarity.Explicitly setting
prerelease: falsedocuments the intended behavior and is a good practice, even if it matches the default value.
95-127: > Likely an incorrect or invalid review comment.
There was a problem hiding this 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.shaat line 118 correctly creates a reference to the tag object rather than directly to the commit.However, if
createTagsucceeds butcreateReffails (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
📒 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 settingprerelease: falseis appropriate for this workflow.
Overview
Fix duplicities in release draft workflow.
Release Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.