act: 'needs' is not defined
Error ERRO[0002] Unable to interpolate string 'echo ${{ needs.pre.output1 }}' - [ReferenceError: 'needs' is not defined]
when try to following workflow:
jobs:
pre:
runs-on: ubuntu-latest
steps:
- run: echo '::set-env name=VAR1::value1'
outputs:
output1: ${{ env.VAR1 }}
job1:
runs-on: ubuntu-latest
needs: [pre]
steps:
- run: echo ${{ needs.pre.outputs.output1 }}
This syntax is working in workflow ran by Github Actions, as we do use it in our project’s CI.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 76
- Comments: 35 (7 by maintainers)
+1
This feature would be really helpful
This is a huge blocker for us. The “needs” parameter enables proper, efficient parallel jobs to be run that have a common set of steps that need to be run for all of them.
We have a number of applications that build for multiple environments but share several common steps. Without being able to use the “needs” option, we have to resort to duplicating steps and waiting on things to run serially which is FAR less than ideal.
Community needs “needs” 😃
+1
@Steph0 - just released https://github.com/nektos/act/releases/tag/v0.2.24
+1
@cplee hi, is there any update on this… ?
I am seeing the same. It seems to only work with the first step of each job.
@hcguersoy-oc Just wanted to let you know if you didn’t notice; the fix was merged yesterday! 😃 (see: #629 as per
mergify
update)I have tried your test workflow from https://github.com/nektos/act/pull/629 > pkg/model/workflow_test.go and it works 😃
Then I inserted a single step ‘doSomething’ before the step with the output assignments and it failed, i.e. all output variables are empty 😦
Can this bug be fixed soon?
Hope the next release is soon with this. Have a hard time convincing my team to think ACT first because of that 😃 Thanks for the work on act tought, i love it
+1