Interview Prep/GitHub Actions/Secrets, Variables, Environments & Permissions

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, Variables, Environments & Permissions