Skip to content

Replace core.debug with core.info in JavaScript files and instructions#1873

Merged
pelikhan merged 3 commits intomainfrom
copilot/update-github-script-logs
Oct 17, 2025
Merged

Replace core.debug with core.info in JavaScript files and instructions#1873
pelikhan merged 3 commits intomainfrom
copilot/update-github-script-logs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 17, 2025

This PR replaces all uses of core.debug with core.info in JavaScript .cjs files used with actions/github-script and updates the associated instructions.

Problem

The codebase was using core.debug() for logging informational messages throughout JavaScript action scripts. The requirement is to standardize on core.info() instead for better visibility and consistency in GitHub Actions logs.

Changes

Instructions

Updated .github/instructions/github-script.instructions.md to remove the recommendation to use core.debug for verbose debug logging from the best practices section.

Production Files

Replaced all 42 occurrences of core.debug() with core.info() across 8 production JavaScript files:

  • add_labels.cjs - Logging for label processing and validation
  • create_discussion.cjs - Logging for discussion creation workflow
  • check_permissions.cjs - Logging for permission checks and validation
  • create_pull_request.cjs - Logging for PR creation steps
  • redact_secrets.cjs - Logging for secret redaction operations
  • compute_text.cjs - Logging for text computation
  • check_membership.cjs - Logging for membership checks
  • validate_errors.cjs - Logging for error validation

Test Files

Updated test assertions in 5 test files to check for core.info instead of core.debug:

  • add_labels.test.cjs - 11 test assertions
  • check_permissions.test.cjs - 6 test assertions
  • create_discussion.test.cjs - 1 test assertion
  • redact_secrets.test.cjs - Test name and 2 assertions
  • validate_errors.test.cjs - Variable name and assertion

Testing

  • ✅ All 534 JavaScript tests pass
  • ✅ All Go tests pass
  • ✅ Formatting and linting checks pass
  • ✅ No core.debug calls remain in production code
  • ✅ Code review completed with no issues

This change improves logging consistency across the codebase and ensures informational messages are properly visible in GitHub Actions workflow runs.

Original prompt

Update instructions and JavaScript .cjs files uses in actions/github-script

  • do not use core.debug, use core.info instead
  • replace all uses of core.debug with core.info

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 17, 2025 16:26
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review October 17, 2025 16:35
@pelikhan pelikhan merged commit a1dda3b into main Oct 17, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/update-github-script-logs branch October 17, 2025 16:36
Copilot AI restored the copilot/update-github-script-logs branch October 17, 2025 16:36
Copilot AI changed the title [WIP] Update logging from core.debug to core.info Replace core.debug with core.info in JavaScript files and instructions Oct 17, 2025
Copilot AI requested a review from pelikhan October 17, 2025 16:36
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants