Reputation: 1104
I have a simple scenario with reusable workflows and secrets which doesn't work as the secrets are empty.
I have 3 GH repositories:
I have added the domain secrets (such as aws access key and aws secret access key) to the domain Domain GH Workflows and passed it with the named secrets to the given workflow using the tutorial from the GH - I do not want to use the "inherit" keyword, as i have to use the parametrized version.
However, only the empty strings are passed, even though I have added those kyes to the Github Repository Secrets of the Domain repository. I have tried also adding it to the environment and using the environment value in the workflows in any part of the flow (microservice repo and domain gh workflow repo).
Do you have any idea of why is it happening and what could be done to fix the problems that I am facing or achieve the similar results with a different approach?
Upvotes: 1
Views: 917
Reputation: 23000
When you don't want to use the inherit
keyword, you need to set each secret in the reusable workflow workflow_call
trigger configuration, and share each secret from the main workflow (calling the reusable) as secrets inputs.
However, in that case, you can only use secrets from the repository workflow calling the reusable workflow.
Note: If you want to avoid duplicating secrets between repositories, there is also the solution of using Organization Secrets to share those secrets in different repository, storing them in only one place.
Upvotes: 2