Skip to content

Support setting multiple secrets at once #6

Open
@pilosus

Description

@pilosus

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions