Improve Action Reliability #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the branch-create GitHub Action to improve input handling, type safety, and error robustness. It also updates the compiled artifact to ensure the distributed
dist/index.jsaligns with the latest source changes.Key Improvements
1. Enhanced Input Handling
github_token,owner,repo,branch,new_name) now include.trim()normalization to prevent whitespace-related issues.2. Improved Type Safety
run()function now returnsPromise<void>with JSDoc documentation for clarity and maintainability.3. Robust Error Handling
unknowncatch block with aninstanceof Errorguard.4. Safer Async Execution
run()invocation withvoid run()to explicitly signal the intentionally unhandled promise.5. Updated Compiled Artifact
dist/index.jsto reflect all refactoring work and maintain consistency with the Action's distributed version.Motivation
These changes improve code clarity, maintainability, and runtime safety. They also align the Action with best practices for TypeScript-based GitHub Actions, reducing the likelihood of silent failures or malformed input scenarios.
Impact
No breaking changes.
The Action’s external behavior remains consistent, with improvements applied internally to resilience, maintainability, and reliability.