Skip to content

[jsweep] Clean add_labels.cjs - #18439

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
jsweep/clean-add-labels-c889ce7043ba3ff9
Closed

[jsweep] Clean add_labels.cjs#18439
github-actions[bot] wants to merge 1 commit into
mainfrom
jsweep/clean-add-labels-c889ce7043ba3ff9

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Cleaned actions/setup/js/add_labels.cjs as part of the jsweep unbloat initiative.

Context type: github-script (uses core, github, context globals)

Changes

add_labels.cjs

  • Removed dead code: Deleted unused HANDLER_TYPE constant that was defined but never referenced anywhere in the file
  • Improved readability: Split long itemNumber ternary assignment across multiple lines for better readability

add_labels.test.cjs

  • Added staged mode test: New test verifies that in staged mode (GH_AW_SAFE_OUTPUTS_STAGED=true), labels are previewed but not submitted to the GitHub API
  • Added blocked patterns test: New test verifies that glob-style blocked label patterns (e.g., internal-*) correctly filter out matching labels while allowing others through
  • Tests increased from 22 → 24

Validation ✅

All four checks passed:

  • ✅ Formatting: npm run format:cjs
  • ✅ Linting: npm run lint:cjs
  • ✅ Type checking: npm run typecheck
  • ✅ Tests: npm run test:js — 24 tests pass

Generated by jsweep - JavaScript Unbloater

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org
  • expires on Feb 28, 2026, 3:17 AM UTC

- Remove unused HANDLER_TYPE constant (dead code)
- Split long itemNumber ternary for readability
- Add 2 new tests: staged mode preview and blocked label patterns (24 total)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan deleted the jsweep/clean-add-labels-c889ce7043ba3ff9 branch August 18, 2026 23:28
Sign up for freeto 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.

1 participant

@pelikhan