Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting multiple secrets at once #6

Open
pilosus opened this issue Apr 1, 2020 · 0 comments
Open

Support setting multiple secrets at once #6

pilosus opened this issue Apr 1, 2020 · 0 comments
Labels
enhancement New feature or request priority: medium

Comments

@pilosus
Copy link
Contributor

pilosus commented Apr 1, 2020

For now workflow_secret supports setting just one key-value at once. Setting multiple secrets requires explicit looping over the keys:

$ cat key_val.txt
SECRET_KEY1=VALUE1
SECRET_KEY2=VALUE2
SECRET_KEY3=VALUE3

$ cat key_val.txt | while IFS='=' read key value; do
    workflow_secret --owner=anna-money --repo=workflow-tools \
      --token="YOUR-PERSONAL-ACCESS-TOKEN" \
      update --key=$key --value=$value
done
{"message": "Secret updated"}
{"message": "Secret updated"}
{"message": "Secret updated"}

It's awkward, it requires to much coding. Let's support bulk operations to create/update secrets.

Things to take into consideration:

  • GitHub is rate limiting requests to the API (5000 reqs/hour)
  • Given the rate limits no async requests really needed, let's do it simple first
  • Stick to existing workflow_tools convention: we can read secret key-value pairs from envfile like we do in workflow_generator when invoked with option -e
@pilosus pilosus added enhancement New feature or request priority: medium labels Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium
Projects
None yet
Development

No branches or pull requests

1 participant