0

i want to set the GITHUB_OUPUT variables dynamically for a job and access them in the other job Below is what i am trying

 par:
  runs-on: ["${{inputs.runner_name}}"]
  output:
  **<HERE I WANT THE VARIABLE OUTPUT TO BE DYNAMIC>**
  steps:
   - name: Par
     shell: powershell
     id: test
     run: |
         cd ${{github.workspace}}
         $json_path =  Get-ChildItem ${{inputs.param_name}} -recurse  | %{$_.FullName}
         $json = Get-Content  $json_path -Raw | ConvertFrom-Json
         $json.psobject.properties | ForEach {  $NAME=$_.Name ; $VALUE=$_.Value; echo $NAME,$VALUE ;echo "$NAME=$VALUE" >> $GITHUB_OUTPUT }
                

In the next job i want to do ( if ${{ needs.par.outputs.<here i know what variable i should reference> }} -ne null ) something like this

Is that possible?

wehelpdox
  • 339
  • 6
  • 16
  • Does this answer your question? [Using output from a previous job in a new one in a GitHub Action](https://stackoverflow.com/questions/59175332/using-output-from-a-previous-job-in-a-new-one-in-a-github-action) – Azeem Apr 20 '23 at 05:14
  • Also, see [Defining outputs for jobs](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs). – Azeem Apr 20 '23 at 05:15

0 Answers0