How to reuse a whole workflow?

Hello everybody,

I think I had a fundamental misunderstandig of Actions. So let me ask something first:

A job in a workflow consists of one more more steps. Steps can use other Actions. But an Action is something else than a workflow, as an Action executes only a single command.

Is this correct?

If my current understanding is correct, how can I share an entire workflow with multiple steps with multiple repositories?

Best,

Oliver

2 Likes

Hey! If you are a little fuzzy on what a GitHub action is and how it’s used, check out this link: https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#about-github-actions

From the docs: “You can write individual tasks, called actions, and combine them to create a custom workflow”

If I am understanding your question right, you want to share a workflow between repos? I am not sure you have have a shared set of workflows between repos. The workflows and actions operate on a repo by repo basis. 

If you want to copy a workflow from one repo too another, you will need to copy the “.github” folder from one repo to the next. This will move over all of your workflows and subsequent actions. 

3 Likes

From the docs: “You can write individual tasks, called actions, and combine them to create a custom workflow”

Yes, I missed this sentence. :confused: But this is that I was afraid of. It would be nice to be able to share workflows.

I will see that fits best my use case. Copying or using a Git submodule.

5 Likes

Why is this thread marked as solved? It’s not solved by any means, reusing a workflow doesn’t seem to be possible in any way – I have copy & pasted my configuration to about 15 projects and each time I want to make a change, I currently have to do it in 15 repositories … :frowning_face:

6 Likes

Why is this thread marked as solved? It’s not solved by any means, reusing a workflow doesn’t seem to be possible in any way – I have copy & pasted my configuration to about 15 projects and each time I want to make a change, I currently have to do it in 15 repositories …

Totally agree, sharing worklows between repos would be a great feature

5 Likes