Reduce custom secret minimum length threshold from 8 to 6 characters#15231
Merged
Reduce custom secret minimum length threshold from 8 to 6 characters#15231
Conversation
Copilot stopped work on behalf of
pelikhan due to an error
February 12, 2026 20:01
Copilot stopped work on behalf of
pelikhan due to an error
February 12, 2026 20:01
Copilot stopped work on behalf of
pelikhan due to an error
February 12, 2026 20:01
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update minimum length of secrets to six characters
Reduce custom secret minimum length threshold from 8 to 6 characters
Feb 12, 2026
pelikhan
approved these changes
Feb 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces the minimum length threshold for custom secret redaction from 8 to 6 characters in redact_secrets.cjs, allowing shorter legitimate secrets (such as 6-7 character API keys) to be redacted while still avoiding false positives from very short strings. Well-known credential patterns (GitHub tokens, API keys, etc.) continue to use regex-based detection independent of this threshold.
Changes:
- Lowered custom secret minimum length from 8 to 6 characters in the redaction logic
- Updated test suite to verify the new boundary: 5-character secrets are skipped, 6-character secrets are redacted
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
actions/setup/js/redact_secrets.cjs |
Changed minimum length check from < 8 to < 6 for custom secrets at line 117 |
actions/setup/js/redact_secrets.test.cjs |
Updated "skip very short values" test to use 5-character secret and added new test case confirming 6-character secrets are now redacted |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Lowered the minimum length threshold for custom secrets from 8 to 6 characters in
redact_secrets.cjs. Well-known secrets (GitHub tokens, API keys, etc.) remain pattern-matched via regex and are unaffected by this threshold.Changes
redact_secrets.cjs: Changed minimum length check from< 8to< 6for custom secretsredact_secrets.test.cjs:Context
Custom secrets are loaded from environment variables and checked against a length threshold before redaction. The
BUILT_IN_PATTERNSarray (16 well-known credential formats) operates independently via regex matching:This allows shorter legitimate secrets (e.g., 6-7 character API keys) to be redacted while avoiding false positives from 1-5 character strings.
💡 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.