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
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.
Describe the feature or problem you’d like to solve
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:--previewor--nowriteor--local) but I think that would be semantically incorrect (the meaning ofsetis explicit).Additional context
github_actions_secret) is unable to describe how to encrypt a secretgh 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.
I'm happy to submit a Pull Request with an implementation for this if it's given the go-ahead.