'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.
+1
any workaround for this?
This feature would be really helpful
Issue is stale and will be closed in 7 days unless there is new activity
Issue is stale and will be closed in 14 days unless there is new activity
+1
+1
+1
+1
+1
+1
+1
+1
Community needs "needs" :)
+1
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.
We are also using the needs parameter in many workflows, but this breaks usage of act and we cant test locally anymore. Adding support for this would be really nice.
Unfortunately here the same: needing needs but it blocks simply using act for our development process.
@hcguersoy-oc
Just wanted to let you know if you didn't notice; the fix was merged yesterday! :) (see: #629 as per mergify update)
When I run this example https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-8
name: Diff AccessDB
on: [pull_request]
jobs:
job1:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
output1: ${{ steps.step1.outputs.test }}
output2: ${{ steps.step2.outputs.test }}
steps:
- id: step1
run: echo "::set-output name=test::hello"
- id: step2
run: echo "::set-output name=test::world"
job2:
runs-on: ubuntu-latest
needs: job1
steps:
- run: echo ${{needs.job1.outputs.output1}} ${{needs.job1.outputs.output2}}
Then I am getting this error in the latest @master version when I run act.
ERRO[0003] Unable to interpolate string '${{ steps.step2.outputs.test }}' - [TypeError: Cannot access member 'outputs' of undefined]
Is this a known limitation?