TL;DR
I want to call the action and pass a string that has comma-separated secret names. That way, I don't know which or how many secrets I'm fetching in advance.
Detailed design
I support a repository for reusable workflows. Different users of my workflows require different secrets from GSM. I can get the names of those secrets as a string input that has them listed as comma-separated values. I would like for a way to then pass that list to your action and get the secrets
E.g.
inputs:
secrets_to_fetch:
type: string
description: "Comma-separated secret names. e.g. 'my_secret,your_secret' "
Then, when you call the workflow you pass "secret_one,secret_two,secret_three" as a value for "secrets_to_fetch". This should then create three entries under the "secrets" block of the action, get those secrets and store them in their respective names. I suppose it would require you to pass projectID as well which should then translate to something along the lines of:
- name: Get Secrets from Secret Manager
id: get-secrets
uses: google-github-actions/get-secretmanager-secrets@v1
with:
project_id: your-project-id
secrets: ${{ inputs.secrets_to_fetch }}
I tried constructing the list myself and saving it as a variable, but neither $GITHUB_ENV nor $GITHUB_OUTPUT seem to like the '\n' character at the end of every variable. It looked something like
secret_one:<project-id>/secret_one\nsecret_two:<project-id>/secret_two
The only way I could get around this restriction is to use "::set-output name=secret1::value1". But "set-output" is deprecated so I have reservations about using it. Further, it still only seems to fetch a single secret but I'm not sure why. I'm also not sure if I should try and add a bunch of white spaces after the newline character (\n) in order to keep the expected formatting of the workflow files.
Overall, there are many unknowns and I haven't had much success with dynamically getting secrets based on input. Is this possible currently and if not are there plans to add it as a feature?
Additional information
No response