Objective
Add documentation about secret size limits to the gh aw secret set command help text.
Context
NaCl sealed boxes are designed for small messages (recommended max 16KB). GitHub Actions API likely has its own limits. Users should be informed about these constraints when setting secrets.
Approach
In pkg/cli/secret_set_command.go, update the command description to include size limit information:
Short: "Set an Actions secret for a workflow",
Long: `Set an Actions secret for a workflow.
The secret value is encrypted using NaCl sealed box encryption before being
sent to GitHub's API. This ensures the secret is encrypted locally and can
only be decrypted by GitHub.
Note: Secrets should be reasonably sized (recommended maximum: 64KB). Very
large secrets may be rejected by GitHub's API or cause performance issues.`,
Additionally, consider adding validation in the encryptWithPublicKey or runSecretSet function to warn or error if the plaintext exceeds a reasonable size (e.g., 64KB):
const maxSecretSize = 64 * 1024 // 64KB
if len(plaintext) > maxSecretSize {
return "", fmt.Errorf("secret value too large (%d bytes), maximum recommended size is %d bytes",
len(plaintext), maxSecretSize)
}
Files to Modify
pkg/cli/secret_set_command.go
Acceptance Criteria
Estimated Effort
15 minutes
Related to #6394
AI generated by Plan Command for discussion #6389
Objective
Add documentation about secret size limits to the
gh aw secret setcommand help text.Context
NaCl sealed boxes are designed for small messages (recommended max 16KB). GitHub Actions API likely has its own limits. Users should be informed about these constraints when setting secrets.
Approach
In
pkg/cli/secret_set_command.go, update the command description to include size limit information:Additionally, consider adding validation in the
encryptWithPublicKeyorrunSecretSetfunction to warn or error if the plaintext exceeds a reasonable size (e.g., 64KB):Files to Modify
pkg/cli/secret_set_command.goAcceptance Criteria
Estimated Effort
15 minutes
Related to #6394