Use version number for GitHub release name - #1223
Conversation
There was a problem hiding this comment.
I'll review this code change to the GitHub Actions workflow file.
Summary
The change modifies the release name in the GitHub Actions workflow from a hardcoded string "emmylua_ls" to use the GitHub reference name (${{ github.ref_name }}).
Issues Found
1. Potential Inconsistent Release Names
- Problem: The release name will now be the tag name (e.g., "v1.2.3") instead of the consistent "emmylua_ls" name. This could break any external scripts, documentation, or processes that expect a consistent release name.
- Suggestion: Consider whether this change is intentional and if any downstream consumers depend on the old naming convention.
2. Missing Context for Tag Events
- Problem: The
github.ref_namewill only contain a meaningful value when the workflow is triggered by a tag push or release event. If this workflow can also be triggered by other events (like push to main branch), the release name could be unexpected (e.g., "main"). - Suggestion: Verify that this job only runs on tag events. If not, add a condition like
if: startsWith(github.ref, 'refs/tags/')to ensure it only runs for tags.
3. No Fallback or Validation
- Problem: There's no validation or fallback if
github.ref_nameis empty or contains unexpected characters. - Suggestion: Consider adding a fallback or validation step, for example:
name: ${{ github.ref_name != '' && github.ref_name || 'emmylua_ls' }}
4. Potential Security Consideration
- Problem: Using
github.ref_namedirectly in the release name could allow injection of special characters if the tag name contains malicious content (though this is low risk since tags are typically controlled by maintainers). - Suggestion: Consider sanitizing the input or using a more controlled naming convention.
Recommendations
-
Confirm Intent: Ensure this change is intentional and that no external tools depend on the old "emmylua_ls" release name.
-
Add Event Guard: If this job can run on non-tag events, add a condition to ensure it only runs for tag pushes:
if: startsWith(github.ref, 'refs/tags/')
-
Consider a More Descriptive Name: Instead of just the tag name, you might want to include the project name for clarity:
name: emmylua_ls ${{ github.ref_name }}
-
Test the Change: Verify that the release creation works correctly with the new naming convention by testing with a sample tag.
Overall Assessment
The change is straightforward and likely intended to make release names more descriptive by including the version/tag. However, it introduces potential issues with consistency and event handling that should be addressed before merging.
Currently every GitHub release has the same hard coded name:
emmylua_ls.So it's a pain to actually see the version list:
This PR fixes the GitHub action and you can easily rename historical releases with: