Skip to content

Extend secret redaction to .md, .mdx, .yml, .jsonl files#2230

Merged
pelikhan merged 3 commits into
mainfrom
copilot/extend-secret-redaction-extensions
Oct 23, 2025
Merged

Extend secret redaction to .md, .mdx, .yml, .jsonl files#2230
pelikhan merged 3 commits into
mainfrom
copilot/extend-secret-redaction-extensions

Conversation

Copilot AI commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Summary

Extended the secret redaction functionality to process .md, .mdx, .yml, and .jsonl files in addition to the existing .txt, .json, and .log files.

Changes

The secret redaction script (pkg/workflow/js/redact_secrets.cjs) now processes a broader set of file types commonly used in agentic workflows:

  • Markdown files (.md, .mdx) - For workflow documentation and AI-generated reports
  • YAML files (.yml) - For configuration files and workflow definitions
  • JSON Lines files (.jsonl) - For structured log output and data files

Modified Files

pkg/workflow/js/redact_secrets.cjs

  • Updated targetExtensions array to include the new file types (line 129)
  • Updated JSDoc documentation to reflect the expanded file type coverage

pkg/workflow/js/redact_secrets.test.cjs

  • Added comprehensive test coverage for all new file extensions
  • Verified correct secret redaction behavior across all file types

Testing

All tests pass successfully:

  • ✅ 9/9 redact_secrets.test.cjs tests
  • ✅ 572/572 total JavaScript tests
  • ✅ TypeScript type checking
  • ✅ Code formatting and linting

The new test case creates files with each extension type and verifies that secrets are properly redacted using the same pattern (first 3 characters + asterisks for remaining length).

Impact

This change ensures that sensitive data in markdown documentation, YAML configurations, and JSON Lines logs are properly redacted before artifacts are uploaded, improving security across a wider range of workflow output files.

Original prompt

Extend the target extensions in the secret redaction javascript to .md, .mdx, .yml, .jsonl files

const targetExtensions = [".txt", ".json", ".log"];

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for additional target extensions in secret redaction Extend secret redaction to .md, .mdx, .yml, .jsonl files Oct 23, 2025
Copilot AI requested a review from pelikhan October 23, 2025 18:49
@pelikhan pelikhan marked this pull request as ready for review October 23, 2025 19:08
@github-actions

Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request.

@pelikhan pelikhan merged commit bf47da3 into main Oct 23, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/extend-secret-redaction-extensions branch October 23, 2025 19:14
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