-
Hello, I have 2 workflows linked by the workflow_run feature.
Both ref are on the same sha. My goal is to keep the “release” part of my workflows isolated, and trigger the “workflow_run” one only when tags are pushed AND the primary workflow completes successfully. first one :
second one :
Is this a known bug ? a known limitation ? is there a workaround ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I created a simple repro :
|
Beta Was this translation helpful? Give feedback.
-
I think this is just a limitation of how this feature works with respect to the way you’re using it. The second workflow is completely independent of the first and will receive a brand new webhook event to trigger it meaning it will just be triggered using the “default” git ref. Is there a specific reason you’re wanting keep this in a completely separate file? For this situation I’d probably recommend just using a separate job inside the same workflow file. You can use the |
Beta Was this translation helpful? Give feedback.
-
I disagree, the second workflow depends of the first, that’s the intention of the "workflow_run’ feature: let workflows depends on others. Or I completely miss the point. In my specific case, I need to know there’s a git tag. (More precisely, I want to know the workflow is running because of a tag.). So the git ref is mandatory. The specific reason I would like to have two separates workflow is just CI structure : having smaller workflow files, and let run specific workflows (like a “publish/release artifact” run only when needed). Moreover, it would allow us to re-use previous parts of the the build. Ex : if I have 5 workflows, and each one need to build and test the whole repository before doing the “remaining part of the job”, it looks like a major resource waste as I could have just build and test the commit once, and then run the “other things” in the 4 or 5 dependent workflows… That’s why I’m convinced git ref should be propagated from “main” workflows to “dependent workflows”. |
Beta Was this translation helpful? Give feedback.
-
Thanks to the GH support, the answer is here : Workflow_run not working as expected - #4 by brightran We can access the original ref with
Problem solved ! 🚀 |
Beta Was this translation helpful? Give feedback.
-
rducom:
What I meant by this was that as this was an entirely separate workflow it would be treated as such. The variables set in this run would be set at start time and not be inherited from the original. But it did slip my mind that you’d be able to check inside the triggering webhook event, so I’m glad you managed to find the answer! |
Beta Was this translation helpful? Give feedback.
Thanks to the GH support, the answer is here : Workflow_run not working as expected - #4 by brightran
We can access the original ref with
Problem solved ! 🚀