Reusable workflows and composite actions
If you start automating with IssueOps, workflows get very complex very fast. You will end up with a lot of if
clauses on jobs and steps. To keep these solutions maintainable, you can use composite actions or reusable workflows to not only reuse functionality but also break down complex workflows into smaller parts.
We have already covered composite actions in previous chapters. In this recipe, we will use a reusable workflow to add the delete functionality to our IssueOps solution.
Getting ready…
Make sure you have completed the previous recipes in this chapter.
How to do it…
- Create a new
delete-repo.yml
workflow file. - As the trigger, we use the
workflow_call
trigger. This indicates that the workflow is a reusable workflow. Define inputs needed by our workflow:on: workflow_call: inputs: REPO_NAME: ...