Can a reusable workflow use the caller's environment secrets?
AdvancedConceptSecrets, Variables, Environments & Permissions
Answer
Not by passing them; environment secrets are resolved inside the job that declares the environment. If the called workflow's job sets environment: prod, it reads prod environment secrets of the caller's repository directly. secrets: inherit passes repo and org secrets, not environment ones. A caller job that uses uses: cannot itself declare environment, so the environment must be declared inside the reusable workflow, usually from an input.
More on Secrets, Variables, Environments & Permissions
Where can secrets be defined, and what is the precedence?BeginnerHow are secrets protected in transit and in logs, and what are the limits?IntermediateAre secrets available to every step automatically?BeginnerWhy is it a bad idea to store structured data like JSON or a whole `.env` file as one secret?IntermediateWhat is an environment, and which protection rules can it have?BeginnerWhen does a job wait for environment approval, and what does the reviewer see?Intermediate