Skip to content

[jsweep] Clean add_reaction_and_edit_comment.cjs#29439

Merged
pelikhan merged 1 commit into
mainfrom
jsweep/add-reaction-and-edit-comment-42dc676ad774e9ba
May 1, 2026
Merged

[jsweep] Clean add_reaction_and_edit_comment.cjs#29439
pelikhan merged 1 commit into
mainfrom
jsweep/add-reaction-and-edit-comment-42dc676ad774e9ba

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 1, 2026

Summary

Cleaned add_reaction_and_edit_comment.cjs as part of the jsweep initiative.

Context type: github-script

Changes

  • Replaced string concatenation ("POST " + endpoint) with template literals (````POST ${endpoint}`````) in two places
  • Simplified addReaction output: collapsed verbose if/else block into a single-line using optional chaining (reactionId?.toString() ?? "") and a ternary for the log message
  • Used template literal for the core.warning message at the end of addCommentWithWorkflowLink

Test Coverage

The existing test file (add_reaction_and_edit_comment.test.cjs) has comprehensive coverage with 33 tests covering all event types and edge cases. All 33 tests pass with these changes.

Validation

  • ✅ Formatting: npm run format:cjs passed
  • ✅ Linting: npm run lint:cjs passed
  • ✅ Type checking: npm run typecheck passed (no errors)
  • ✅ Tests: 33 tests passed

Generated by jsweep - JavaScript Unbloater · ● 1.5M ·

  • expires on May 3, 2026, 4:24 AM UTC

- Replace string concatenation with template literals for POST endpoint calls
- Simplify addReaction output: collapse if/else into single-line optional chaining
- Use template literal for warning message

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 1, 2026 04:27
Copilot AI review requested due to automatic review settings May 1, 2026 04:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cleans up add_reaction_and_edit_comment.cjs as part of the jsweep initiative by modernizing string construction and simplifying reaction output handling without changing behavior.

Changes:

  • Switched REST github.request calls from string concatenation to template literals.
  • Simplified addReaction logging/output logic using optional chaining and nullish coalescing.
  • Converted a core.warning message to a template literal.
Show a summary per file
File Description
actions/setup/js/add_reaction_and_edit_comment.cjs Refactors request strings and reaction output/log formatting for readability/consistency.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request May 1, 2026
@pelikhan pelikhan merged commit 24e879b into main May 1, 2026
29 checks passed
@pelikhan pelikhan deleted the jsweep/add-reaction-and-edit-comment-42dc676ad774e9ba branch May 1, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants