Reusable workflow depth error

This week, I started getting a workflow depth error on my reusable workflows (called with workflow_call). Here’s the error:

[ Invalid workflow file : .github/workflows/my_workflow.yaml#L1]

error parsing called workflow “example/example/.github/workflows/my_workflow.yaml@master”: workflow is invalid: job “a job name” calls workflow “example/example/.github/workflows/my_workflow_reusable.yaml@master”, but doing so would exceed the limit on called workflow depth of 2

What’s going on here? I see zero documentation anywhere about this error.

If I kick off a run of my_workflow.yaml, it runs fine. This error only appears when I run my reusable workflow.

Based on the error message alone, it appears my_workflow_reusable.yaml is calling another workflow, which is not permitted.

Reusable workflows can’t call other reusable workflows.
Reusing workflows

If this is not the case, could you share your workflows?

Sure thing!

The reusable workflow is:


on: [workflow_dispatch, push, pull_request]

jobs:
  static_analysis:
    uses: example/example/.github/workflows/my_workflow_reusable.yaml@master_copy
    secrets:       
      SECRET_ONE: ${{ secrets.ONE }}
      SECRET_TWO: ${{ secrets.TWO }}
      SECRET_THREE: ${{ secrets.THREE }}
      SECRET_FOUR: ${{ secrets.FOUR }}

As I was typing this out, I see my error. I called the reusable workflow from itself :man_facepalming: I’m now calling the correct workflow and it’s working. If anyone else has this problem, you may have done the same.

Thank you for your help, @mcaskill!