Jobs if condition does not work with workflow_dispatch inputs

The following build script doesn’t respect the job’s if condition. is it a bug or I’m making a mistake?


name: Build project

on:
  workflow_dispatch:
    inputs:
      buildForiOS:
        description: 'Build for iOS?'
        required: true
        default: 'true'

jobs:
    BuildForiOsPlatform:
      if: ${{ github.event.inputs.buildForiOS }} == 'true'
    # when buildForiOS is not true this shouldn't run but it always run !
      steps:
        - uses: actions/checkout@v2

I believe you need:
if: ${{ github.event.inputs.buildForiOS == 'true' }}

@kingthorin Good catch, Thanks a lot. It’s working now

1 Like

Great, glad you got it sorted out.