-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIgood first issuehelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you’d like to solve
dev:~$ gh secret encrypt
Paste your secret: *************
✓ Encrypted secret for `org/repository`
QkMFB+vyCCE2yT5j6Tb07doxD2xKHagI2l6AjMuwUkizN7pMGXKBVOj154Pg/hwn0PbPWFvo83z+ir25iw==Proposed solution
Separate the encryption step and make it available as a separate command so that users can easily generate an encrypted secret for their repository/organisation in infrastructure automation. An alternative might be a simple flag on set (e.g: --preview or --nowrite or --local) but I think that would be semantically incorrect (the meaning of set is explicit).
Additional context
- Terraform Provider documentation (
github_actions_secret) is unable to describe how to encrypt a secret - GitHub's Actions Create or update an organization secret documentation recommends a bunch of Javascript, would be much nicer if it was able to say "run
gh secret encrypt..."
There are hacks to grab the encrypted value now, like enabling debugging with API output which exposes the encrypted value in the request body -- and then deleted from the repository/organisation.
dev:~$ DEBUG=api gh secret set example
> PUT /repos/org/repository/actions/secrets/example HTTP/1.1
...
{
"encrypted_value": "QkMFB+vyCCE2yT5j6Tb07doxD2xKHagI2l6AjMuwUkizN7pMGXKBVOj154Pg/hwn0PbPWFvo83z+ir25iw==",
"key_id": "568250167242549743"
}I'm happy to submit a Pull Request with an implementation for this if it's given the go-ahead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgood first issuehelp wantedContributions welcomeContributions welcome