Reusable workflow cannot find 'action.yml', 'action.yaml' or 'Dockerfile' #27362
-
In my repository, we've got a workflow that pushes our code to staging on pushes to main; I want to turn that into a reusable workflow so I can call it from a second workflow that creates a release branch and pushes that branch to staging. However, when I try to call the reusable workflow, I get My caller workflow:
I've tried a bunch of different options from various StackOverflow and community posts, including moving the job out of a step and into its own job, but I haven't been able to get the syntax right for any of them, or else it fails with the same error. What's the right way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
This looks like you're trying to call the reusable workflow as a step, which isn't possible.
Reusable workflows must be called as jobs. If you want to reuse your code at the step level, take a look at composite actions. Which fits better depends on what your code does, in short a reusable workflow is good if you want to reuse a workflow exactly as it is (possibly with parameters), custom actions (composite or not) are good if you want building blocks to use as steps in other workflows. |
Beta Was this translation helpful? Give feedback.
This looks like you're trying to call the reusable workflow as a step, which isn't possible.
Reusable workflows must be called as jobs. If you want to reuse your code at the step level, take a look at composite actions.
Which fits better depends on what your code does, in short a reusable workflow is good if you want to reuse a workflow exactly as it is (possibly with parameters), custom actions (composite or not) are good if you want building blocks to use as steps in other workflows.