I have the following GitHub worflow code:
- name: Check if the project is central
id: projectcheck
run: echo "::set-output name=central::${{ contains(github.event.inputs.project, 'central') }}"
- name: output
run: echo ${{ steps.projectcheck.outputs.central }}
--- here I am getting true/false correctly based on the input project but the below if conditions are not working
- name: if central
if: ${{ steps.projectcheck.outputs.central }} == "true"
run: echo "central"
- name: if not central
if: ${{ steps.projectcheck.outputs.central }} == "false"
run: echo "central"
How can I make the if expression work?
Try for testing
if: steps.projectcheck.outputs.central == 'true'
Ìf steps.projectcheck.outputs.central is a string literal, you should not need ${{ }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With