Tech Bits and Bobs #1 - Reference GitHub Repository and Deployment Environment Secrets and Variables in Reusable Workflows

In this edition of Tech Bits and Bobs I would like to give a quick overview of how to reference variables and secrets, that are defined in the repository variables and secrets and in a GitHub Deployment Environment, in a reusable GitHub workflow. Disclaimer: there’s a tiny nuance to be aware of when it comes to referencing secrets 😼 The good thing is that you can reference all the variables and secrets that are coming both from the repository secrets and variables and the deployment environments in a regular way, i.e. ${{ secrets.MY_SECRET_FROM_ANYWHERE }} or ${{ vars.MY_VAR_FROM_ANYWHERE }}. The only caveat here is that when you want to reference secrets in a reusable workflow, be it from the repo or a deployment environment, you need to provide secrets: inherit parameter in the parent workflow job that is calling upon a reusable workflow. This parameter allows reusable workflow to access the secrets that the parent workflow has access to. ...

July 7, 2025 · 3 min · Kristina Devochko