Nested workflows in GitHub actions

I have some pretty big workflows (5) that share around 70% of the code.

Is it possible to reuse part of the common code of the workflows and reduce the code duplication?

9 Likes

Have you looked at YAML anchors?

https://medium.com/@kinghuang/docker-compose-anchors-aliases-extensions-a1e4105d70bd

Or maybe there should be option to create Action template using yml synatx and then import the same templates based on the use-case.

Anchors are not supported in Actions; nothing changed since https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336#M406 (tried few days ago out of curiosity).

You are right! I am quite surprised by this since yaml anchors are such an important feature to simplify job description. Is there any official word from github on this atm?