-
Notifications
You must be signed in to change notification settings - Fork 5
Update release actions #35
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughTwo GitHub workflow files for dashboard and translator releases are enhanced with automated changelog generation, structured release notes, conditional draft vs. published release paths, version bump automation, and improved notifications and PR creation logic. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Actions
participant Git as Git Repository
participant API as GitHub API
participant Notify as Notification System
GitHub->>Git: Fetch full history (fetch-depth: 0)
GitHub->>Git: Retrieve previous tag (dashboard-v*)
GitHub->>GitHub: Generate/Fetch Changelog<br/>(from git logs or URL)
GitHub->>GitHub: Generate Release Notes<br/>(with stats & changelog)
alt Custom Changelog OR Skip Approval
GitHub->>API: Create Published Release
GitHub->>Notify: Send Success Notification
else No Custom Changelog AND Needs Approval
GitHub->>API: Create Draft Release
GitHub->>Notify: Send Draft Created Alert
Note over GitHub,API: Awaiting Maintainer Review<br/>and Approval
end
alt Release Published (Draft or Direct)
GitHub->>Git: Create/Update version bump branch
GitHub->>GitHub: Bump version in config files<br/>(package.json, badges, README)
GitHub->>API: Create/Update Pull Request<br/>(version bump)
GitHub->>API: Update "latest" release info
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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 |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/translator-release.yml (1)
9-20: Missingchangelog_urlandskip_approvalinput definitions.The workflow references
github.event.inputs.changelog_urlandgithub.event.inputs.skip_approvalthroughout (lines 230, 352, 367, 383, 400, 410, 575, 586), but these inputs are not defined in theworkflow_dispatchconfiguration. This will cause:
changelog_urlto always be empty, so custom changelogs can never be providedskip_approvalto never equal'true', so published releases and version bumps will never trigger via manual dispatch- Draft releases will always be created when using workflow_dispatch
🔎 Proposed fix: Add missing input definitions
workflow_dispatch: inputs: create_release: description: 'Create GitHub Release' required: false default: false type: boolean release_tag: description: 'Release tag (e.g., translator-v1.0.0)' required: false default: '' type: string + changelog_url: + description: 'URL to fetch custom changelog (optional)' + required: false + default: '' + type: string + skip_approval: + description: 'Skip draft and publish release directly' + required: false + default: false + type: boolean.github/workflows/dashboard-release.yml (1)
9-20: Missingchangelog_urlandskip_approvalinput definitions.Same issue as translator-release.yml: the workflow references
github.event.inputs.changelog_urlandgithub.event.inputs.skip_approvalthroughout, but these inputs are not defined. This breaks the custom changelog and skip-approval functionality.🔎 Proposed fix: Add missing input definitions
workflow_dispatch: inputs: create_release: description: 'Create GitHub Release' required: false default: false type: boolean release_tag: description: 'Release tag (e.g., dashboard-v1.0.0)' required: false default: '' type: string + changelog_url: + description: 'URL to fetch custom changelog (optional)' + required: false + default: '' + type: string + skip_approval: + description: 'Skip draft and publish release directly' + required: false + default: false + type: boolean
🧹 Nitpick comments (4)
.github/workflows/translator-release.yml (3)
351-378: Updatesoftprops/action-gh-releaseto v2.The action
softprops/action-gh-release@v1is outdated. Version v2 includes improvements and bug fixes. This applies to both the draft release (line 353) and published release (line 368) steps.🔎 Proposed fix
- name: Create GitHub Release (Draft for Review) if: steps.changelog.outputs.using_custom_changelog == 'false' && github.event.inputs.skip_approval != 'true' - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: ... - name: Create GitHub Release (Published) if: steps.changelog.outputs.using_custom_changelog == 'true' || github.event.inputs.skip_approval == 'true' - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: ...
229-234: Consider validating the changelog URL before fetching.The workflow fetches content from a user-provided URL without validation. While this is mitigated by requiring write access to trigger the workflow, consider adding URL validation (e.g., restricting to trusted domains) or sanitizing the fetched content to prevent potential markdown injection in release notes.
240-274: Author attribution may be inaccurate.The changelog uses
%an(author name from git) with@%sformat, implying a GitHub mention. However, git author names often differ from GitHub usernames (e.g., "John Doe" vs "@johndoe"), which would create broken mentions. Consider using%ae(author email) to look up the GitHub username, or simply omit the@prefix..github/workflows/dashboard-release.yml (1)
425-452: Updatesoftprops/action-gh-releaseto v2.Same as translator workflow - update both instances (lines 427 and 442) to use
softprops/action-gh-release@v2.🔎 Proposed fix
- name: Create GitHub Release (Draft for Review) if: steps.changelog.outputs.using_custom_changelog == 'false' && github.event.inputs.skip_approval != 'true' - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 ... - name: Create GitHub Release (Published) if: steps.changelog.outputs.using_custom_changelog == 'true' || github.event.inputs.skip_approval == 'true' - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 ...
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/dashboard-release.yml.github/workflows/translator-release.yml
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/dashboard-release.yml
274-274: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
426-426: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
427-427: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
441-441: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
457-457: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
474-474: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
484-484: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
484-484: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
702-702: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
702-702: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
713-713: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
713-713: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
.github/workflows/translator-release.yml
217-217: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
352-352: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
353-353: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
367-367: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
383-383: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
400-400: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
410-410: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
410-410: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
575-575: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
575-575: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
586-586: property "changelog_url" is not defined in object type {create_release: string; release_tag: string}
(expression)
586-586: property "skip_approval" is not defined in object type {create_release: string; release_tag: string}
(expression)
🔇 Additional comments (7)
.github/workflows/translator-release.yml (3)
424-441: LGTM!The version parsing logic correctly handles semantic versioning. The job's
ifcondition at line 410 ensures this only runs for stable releases (versions without-), which prevents parsing issues with pre-release versions.
194-213: LGTM!The full history fetch and previous tag detection are correctly implemented. The fallback to the first commit when no previous tag exists handles the initial release case appropriately.
288-349: LGTM!The release notes generation is comprehensive, including key features, statistics, changelog, resources, and build info. The structure provides good visibility for users reviewing the release.
.github/workflows/dashboard-release.yml (4)
260-345: LGTM!The changelog generation logic mirrors the translator workflow and is correctly implemented. The same minor considerations about URL validation and author attribution apply here.
498-515: LGTM!The yarn.lock artifact handling is well-implemented. Using
continue-on-error: trueon the download step gracefully handles cases where the artifact doesn't exist, and the subsequent copy step includes appropriate existence checking.
648-692: LGTM!The PR creation/update logic is well-structured with comprehensive descriptions. The PR body includes all relevant release information and clear instructions for reviewers.
700-726: Notification logic is correct, pending input fixes.The conditional notifications for draft vs. published releases are well-designed. Once the missing
changelog_urlandskip_approvalinputs are added, these will function as intended.
Purpose
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.