The first one doesn’t work because you’re trying to call the reusable workflow in a step, which isn’t possible (that’s for custom actions). A reusable workflow must be called at the job level.

Point three under Using inputs and secrets in a reusable workflow has an example. I notice it also says there:

Workflows that call reusable workflows in the same organization or enterprise can use the inherit keyword to implicitly pass the secrets.

I hope that doesn’t mean you can’t use that for workflows owned by the same personal account.

🌐
GitHub
docs.github.com › en › actions › how-tos › reuse-automations › reuse-workflows
Reuse workflows - GitHub Docs
You can use jobs.<job_id>.secrets in a calling workflow to pass named secrets to a directly called workflow. Alternatively, you can use jobs.<job_id>.secrets.inherit to pass all of the calling workflow's secrets to a directly called workflow.
Discussions

Support secret inheritence `secrets: inherit` for actions
Reusable workflow supports secrets: inherit, this allows the author of the workflow to access secrets set by the configuration without the calling workflow aware of the internals of the reusable workflow it calls. It makes it easy to maintain a changing environment in which callable workflows evolve and use more secrets. I am aware that the initial design of actions ... More on github.com
🌐 github.com
8
August 27, 2022
Enhancement: Streamlining secret inheritance to environment in reusable workflows
🔍 Issue Description: Currently, when using reusable workflows in GitHub Actions, there is a complexity in passing secrets to these workflows. Even with the use of secrets: inherit, secrets still re... More on github.com
🌐 github.com
2
July 10, 2024
How to use reusable GitHub workflows and keep secrets in a single place? - Stack Overflow
Now you can simply pass the secrets: inherit to the reusable workflow and the secrets will be inherited from the calling workflow. Learn more about reusable workflows in GitHub Actions and jobs..steps[*].uses. More on stackoverflow.com
🌐 stackoverflow.com
Actions: Expand `secrets: inherit` documentation
Workflows that call reusable workflows ... use the inherit keyword to implicitly pass the secrets. Implicitly passed how? From what? This could use a bit of love to better explain how it works and how to utilize the feature. A larger example of how this feature works would greatly assist in end users understanding how to actually utilize it in their own builds. ... actionsThis issue or pull ... More on github.com
🌐 github.com
11
March 9, 2023
🌐
GitHub
github.com › actions › toolkit › issues › 1168
Support secret inheritence `secrets: inherit` for actions · Issue #1168 · actions/toolkit
August 27, 2022 - Reusable workflow supports secrets: inherit, this allows the author of the workflow to access secrets set by the configuration without the calling workflow aware of the internals of the reusable workflow it calls.
Author   alonbl
🌐
GitHub
github.blog › home › changelogs › github actions: simplify using secrets with reusable workflows
GitHub Actions: Simplify using secrets with reusable workflows - GitHub Changelog
March 22, 2025 - GitHub Actions simplifies using secrets with reusable workflows with the secrets: inherit keyword. Previously when passing secrets to a reusable workflow, you had to pass each secret as a separate…
🌐
GitHub
github.com › actions › runner › issues › 3379
Enhancement: Streamlining secret inheritance to environment in reusable workflows · Issue #3379 · actions/runner
July 10, 2024 - Ideally, secrets passed with secrets: inherit should be automatically available to the reusable workflows without the need for explicit environment variable declaration within the reusable workflow’s env section. This enhancement would significantly benefit those of us who maintain multiple related workflows across different projects, each requiring access to their unique set of secrets. ... You can’t perform that action at this time.
Author   OmerraMonday
🌐
GitHub
github.com › orgs › community › discussions › 44426
Can we inherit repo variables the same way we can inherit secrets when calling another workflow? · community · Discussion #44426
When calling another workflow, it's possible for the current secrets to be passed by using secrets: inherit. With the new variables functionality, is it possible to do something similar?
Find elsewhere
Top answer
1 of 6
30

Check if the new (May 2022) keyword secrets: inherit can help:

GitHub Actions: Simplify using secrets with reusable workflows

GitHub Actions simplifies using secrets with reusable workflows with the secrets: inherit keyword.

Previously when passing secrets to a reusable workflow, you had to pass each secret as a separate argument.

Now you can simply pass the secrets: inherit to the reusable workflow and the secrets will be inherited from the calling workflow.

Learn more about reusable workflows in GitHub Actions and jobs.<job_id>.steps[*].uses.

In the reusable workflow, reference the input or secret that you defined in the on key in the previous step.

If the secrets are inherited using secrets: inherit, you can reference them even if they are not defined in the on key.

jobs:
 reusable_workflow_job:
   runs-on: ubuntu-latest
   environment: production
   steps:
     - uses: ./.github/workflows/my-action
       with:
         username: ${{ inputs.username }}
         token: ${{ secrets.envPAT }}

In the example above, envPAT is an environment secret that is been added to the production environment. That environment is therefore referenced within the job.

Note: Environment secrets are encrypted strings that are stored in an environment that you have defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "Using environments for deployment."

Again, see jobs.<job_id>.steps[*].uses for additional examples.


As noted by wkhatch in the comments:

I do not believe this syntax is correct for using a reusable workflow, but is correct for using reusable actions. You cannot call a reusable workflow as a step, but you can with an action.


March 2025: As noted by Mickael V.'s comment, if you rely only on secrets: inherit without further organization, you would indeed have to set the secrets individually in all calling repositories... which does not scale well.


Sept. 2025: tamas.kenez comments that the caller job that uses a reusable workflow supports only with: and secrets:. Putting environment: there triggers Unexpected value 'environment'.

That means you would need to put environment: inside the called workflow's own job(s).

As an example of a reusable (called) workflow in a central repository (using here slackapi/slack-github-action:

# secrets-repo/.github/workflows/slack-notify.yml
name: Notify Slack

on:
  workflow_call:
    inputs:
      message:
        required: true
        type: string

jobs:
  notify_slack:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - name: Send Slack notification
        uses: slackapi/slack-github-action@v2
        with:
          channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
          slack-message: ${{ inputs.message }}
        env:
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

Called by:

# any-repo/.github/workflows/notify.yml
name: Call central Slack notify

on:
  push:
    branches: [ main ]

jobs:
  notify:
    uses: my-org/secrets-repo/.github/workflows/slack-notify.yml@main
    with:
      message: "Build successful"
    secrets: inherit

Kaspar H comments: "secrets resolve to the caller's repo, not the called repo"

That seems to be the default with reusable workflows (and with secrets: inherit): the called workflow receives the caller's secrets. To centralize secrets once and avoid per-repo duplication, keep them as environment secrets in the called repo, and make the called workflow's jobs declare environment:.

2 of 6
10

This exact scenario is addressed in the GitHub roadmap issue GitHub Actions secrets improvements for Reusable workflows:

With this current improvement, teams managing reusable workflows can refer to the secrets from the called (source) repos. These secrets are available only in the reusable workflow run context within in the caller (target) repos.

Unfortunately, as of March 2024, the issue is scheduled for "Future"; there are columns up to Q4 2024.

🌐
Medium
medium.com › @reach2shristi.81 › using-secrets-with-github-workflows-9e5914211f75
Using secrets with Github Workflows | by Min_Minu | Medium
October 30, 2024 - Go to Settings > Secrets and variables > Actions. Click New repository secret and name your secret with only alphanumeric characters or underscores (no spaces). Enter the secret’s value, then Add secret.
🌐
GitHub
github.com › actions › runner › discussions › 3572
Inherit secret and pass specific secret to reusable workflow · actions/runner · Discussion #3572
name: use reusable workflow on: push: branches: - nvi/test-composite-actions # Limit permissions of the GITHUB_TOKEN permissions: contents: read # needed to fetch source packages: write # neeed to push image to ghcr.io jobs: call-build-docker-devenv: uses: org/my-actions/.github/workflows/reusable@<ref> with: access_token_key: CALLER_REPO_TOKEN secrets: inherit
Author   actions
🌐
GitHub
github.com › github › docs › issues › 24366
Actions: Expand `secrets: inherit` documentation · Issue #24366 · github/docs
March 9, 2023 - Workflows that call reusable workflows in the same organization or enterprise can use the inherit keyword to implicitly pass the secrets. Implicitly passed how? From what? This could use a bit of love to better explain how it works and how to ...
Author   JLLeitschuh
🌐
GitHub
github.com › orgs › community › discussions › 150902
Github actions reusable workflow secrets inheritance not working · community · Discussion #150902
If the secrets are inherited by using secrets: inherit in the calling workflow, you can reference them even if they are not explicitly defined in the on key.
🌐
Medium
medium.com › postnl-engineering › how-to-integrate-github-workflows-into-your-project-36a568ab0326
How to Integrate GitHub Workflows into Your Project | by Özge Kavalcı | PostNL Engineering | Medium
July 5, 2023 - ... When you are calling a reusable workflow if you add the “inherit” keyword then all the secrets in the application repository will be inherited to reusable workflow during the workflow run. jobs: call-workflow: uses: Sample-Organizat...
🌐
GitHub
docs.github.com › actions › security-guides › using-secrets-in-github-actions
Using secrets in GitHub Actions - GitHub Docs
Learn how to create secrets at the repository, environment, and organization levels for GitHub Actions workflows.
🌐
Blacksmith
blacksmith.sh › blog › best-practices-for-managing-secrets-in-github-actions
Best Practices for Managing Secrets in GitHub Actions | Blacksmith
For a detailed understanding of how GitHub does this, refer to GitHub's official documentation on security hardening for GitHub Actions. Access Control: Secrets are only accessible to workflows that explicitly reference them. Even then, they're only decrypted when the workflow runs and are automatically redacted from any logs. Inheritance and Precedence: Secrets follow a specific precedence order, Environment secrets take priority over repository secrets, which in turn take precedence over organization secrets.
🌐
Cloud Chronicles
cloudchronicles.blog › blog › Passing-Environment-Secrets-and-Variables-to-Reusable-Workflows-in-GitHub-Actions
Passing Environment Secrets and Variables to Reusable Workflows in GitHub Actions | Cloud Chronicles
February 21, 2026 - By default only secrets explicitly ... secrets: inherit allows all secrets from the caller to be available in the reusable workflow, including environment secrets once the environment is set at the job level....
🌐
Reddit
reddit.com › r/devops › github actions reusable workflow doesn't recognize secrets
r/devops on Reddit: Github Actions reusable workflow doesn't recognize secrets
October 3, 2023 -

I'm running Github Actions within my organization's repos. I created a reusable workflow that I apply to multiple repos.

Here is a snippet from the reusable workflow:

name: reusable-workflow
on:
  workflow_call:
    inputs:
      post_build_custom_command:
        description: "Custom command to run after build"
        required: false
        type: string
        default: ''

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Build
      run: npm run build

    - name: Post Build Custom Command
      run: |
        ${{ inputs.post_build_custom_command }}
      if: ${{ inputs.post_build_custom_command }}

I want to specifically focus on the Post Build Custom Command task. I had to create this "custom command" input to run a bash script which is custom to the caller repo.

In my caller repo, I call the reusable workflow as so:

name: caller-workflow

on:
  pull_request:
    branches: [main]

jobs:
  reusable-workflow:
    name: reusable-workflow
    uses: org/workflows/.github/workflows/reusable-workflow.yml@main
    with:
      post_build_custom_command: |
        echo "${{ secrets.PRIVATE_KEY }}" > /tmp/key.pem
    secrets: inherit

I get the following error:

The workflow is not valid. .github/workflows/workflow.yml (Line: 23, Col: 34): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.PRIVATE_KEY

Can someone help me to find a fix or a workaround for this?

🌐
GitHub
github.com › orgs › community › discussions › 158322
GHA reports missing or wrong secrets if used via "secrets: inherit" and in combination with workflow templates · community · Discussion #158322
on: push: create: workflow_dispatch: jobs: Pipeline: uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@dev permissions: contents: write # required for create tag actions: write # required for trigger workflow with: package_name: sphinx_reports unittest_python_version_list: '3.11 3.12 3.13' codecov: true codacy: true dorny: true secrets: inherit
🌐
GitHub
github.com › orgs › community › discussions › 69082
Github Actions reusable workflow doesn't recognize secrets · community · Discussion #69082
October 3, 2023 - For inputs, the data type of the ... number, or string). Workflows that call reusable workflows in the same organization or enterprise can use the inherit keyword to implicitly pass the secrets....