Use subworkflow from a relative path in the same repository #1419
-
Is there a way to use sub-workflow which lives in the same repository and reference it via a relative path? We want to use the version which lives in the commit that triggered the build (as it could have been modified in the very same commit...) We can use composite actions like this:
We want the same with workflows:
Docs do not mention it https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses, and, unsurprisingly, the above does not work. An attempt to force version to current sha, did not work either (
Any ideas? We were very excited about the ability to split our humongous monorepo CI yaml into subworkflow files, but that inability to just use the file that lives next to the main workflow looks like a dealbreaker... |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 4 replies
-
Hi @gustaff-weldon, I'm the product manager for reusable workflows. Thanks for trying out the feature and letting us know your thoughts so far. You mentioned that this is a dealbreaker for you. Can you expand on that? Why does it stop you from breaking up your humongous monorepo? |
Beta Was this translation helpful? Give feedback.
-
Is this released? |
Beta Was this translation helpful? Give feedback.
-
Have the same issue (splitting ci.yml into subworklows): aio-libs/aiohttp#6264 Would be nice to have relative workflow path support! |
Beta Was this translation helpful? Give feedback.
-
Would love this! Have similar motivations as the author. |
Beta Was this translation helpful? Give feedback.
-
See https://github.community/t/ref-head-in-reusable-workflows/203690 |
Beta Was this translation helpful? Give feedback.
-
For those people who uses GitHub Enterprise, this feature (or bug fix?) is released in |
Beta Was this translation helpful? Give feedback.
-
Hey! This seems to work now: https://github.blog/changelog/2022-01-25-github-actions-reusable-workflows-can-be-referenced-locally/ jobs:
call-workflow-in-local-repo:
uses: ./.github/workflows/workflow-2.yml For me, I had to use the ./ at the beginning instead of my organization name. |
Beta Was this translation helpful? Give feedback.
-
@hubol yes, Github released this feature: github/roadmap#98 and https://docs.github.com/en/actions/using-workflows/reusing-workflows |
Beta Was this translation helpful? Give feedback.
@hubol yes, Github released this feature: github/roadmap#98 and https://docs.github.com/en/actions/using-workflows/reusing-workflows