Skip to content

[plan] Document secret size limits in CLI help #6399

@github-actions

Description

@github-actions

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

  • Command help text mentions secret size considerations
  • Documentation references encryption method (NaCl sealed box)
  • Optional: Add validation for maximum secret size with clear error message
  • Help text is clear and user-friendly
  • Existing tests continue to pass

Estimated Effort

15 minutes
Related to #6394

AI generated by Plan Command for discussion #6389

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions