Importing multiple secrets one at a time could be slightly time consuming, depending how many secrets there are.
Proposed changes#
- Proposed change 1:
- There could be a button in the repository settings via "settings > pipelines > secrets", which has its own separate dialog (like the "+ add secret" button).
- The content is parsed with a package like https://github.com/joho/godotenv, which then gets encrypted the same way secrets already are.
- Proposed change 2:
- The current "+ add secret" could also allow pasting a string in the pattern of a "KEY=VALUE", which is then parsed with the same package. The key text input would listen to the
pasteevent, which would detect if the string matches the pattern. If it does, it would automatically move the value string into the value input. The dialog's description should also explain this to make the UX affordance explicit.
- The current "+ add secret" could also allow pasting a string in the pattern of a "KEY=VALUE", which is then parsed with the same package. The key text input would listen to the
Proposal implementation#
I'm imagining something like below:
Settings page#

The import dialog#

sounds good to me. I think having single "add secret" button with
KEY=VALUEtextarea dialog is a way to go.