Check if workflow is being re-used

Hello. I am trying to check within a workflow if said workflow is being re-used as part of another workflow.

For example, this step should only run if the workflow was the result of a workflow_call:

      - name: "Upload Docker Image Artifact"
        if: ${{ github.event_name == 'workflow_call' }}
        uses: actions/upload-artifact@v2
          name: image-${{ matrix.arch }}
          path: /tmp/image-${{ matrix.arch }}.tar

However, the check fails because the parent workflow was triggered by a “push” and so github.event_name == “push”, not “workflow_call”

Is there a way to do this?

Thank you

1 Like

Same doubt here. I used workflow_dispatch event on the calling workflow, and github.event_name returned workflow_dispatch instead of workflow_call.

I’m also seeing this behaviour. Is there any update on whether it’s possible to determine whether a workflow was triggered using workflow_call?