Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make sure the type checking of "core.*" APIs is working in JavaScript .cjs files.
For example, some files use "core.warn" function which is not a valid function and should trigger a type check error
Fix core.warn API usage and enable comprehensive type checking for JavaScript files
Sep 12, 2025
pelikhan
approved these changes
Sep 12, 2025
Collaborator
|
@copilot merge origin/main . The only interesting changes are in the .cjs file. Take all the other changes from the upstream |
…bebc-4927-8067-06a6122ec497
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The TypeScript type checking system was not properly validating
core.*API usage in JavaScript.cjsfiles, allowing invalid method calls likecore.warn()to pass undetected.Problem
Several JavaScript files were using
core.warn(), which doesn't exist in the@actions/corelibrary. The correct method iscore.warning(). Additionally, many.cjsfiles were not included in the TypeScript configuration, meaning type errors went undetected.For example, this invalid code was not being caught:
Solution
core.warn()with the correctcore.warning()method.cjsfiles totsconfig.jsonthat were previously not being type-checkedcore.warningmethod instead of the invalidcore.warnFiles Changed
pkg/workflow/js/add_reaction_and_edit_comment.cjs- Fixedcore.warn()callspkg/workflow/js/validate_errors.cjs- Fixedcore.warn()usagepkg/workflow/js/validate_errors.test.cjs- Updated test mocks and expectationstsconfig.json- Added comprehensive list of.cjsfiles for type checkingVerification
The type checking system now properly catches invalid
core.*API usage:All JavaScript tests continue to pass (324 tests), confirming the fixes work correctly while maintaining existing functionality.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.