How can I use input variables mentioned in the workflow_dispatch pipeline in my workflow_run pipeline?
I can save input variables to environment variables if only they can be retrieved or I can even make the output variables but How to retrieve these variables in workflow_run is unknown to me can someone help me with this?
sample workflow_dispatch pipeline:
name: Deploy Manual Pipeline
on:
workflow_dispatch:
inputs:
env:
description: 'The runtime environments of pipeline.'
required: true
default: 'Development'
type: choice
options:
- Development
- QA
- Stage
- Production
env:
inputvariable: ${{ inputs.version }}
jobs:
deploy-to-abc:
runs-on: ubuntu-22.04
outputs:
my_output: ${{ inputs.version }}
steps:
- name: check variable
run: echo the input is ${{ inputs.version }}
sample workflow_run pipeline:
name: Some checks Pipeline
on:
workflow_run:
workflows: ["Deploy Manual Pipeline"]
types: [completed]
branches: [dev, qa]
jobs:
deploy-to-xyz:
runs-on: ubuntu-22.04
steps:
- name: check variables
run: |
echo ${{ github.event.workflow_run.conclusion }}
echo ${{ github.event.workflow_run.head_branch }}
echo ${{ github.inputs.version }} # how to get this?
echo ${{ github.env.inputvariable }} # how to get this?
ech0 ${{ github.event.workflow_run.conclusion.outputs.my_output }}" # how to get this?