         name = 'redhat' if name.toLowerCase() is 'red hat'
         # Remove patch version (eg centos 7.8)
         version = "#{match[0]}" if match = /^(\d+)\.(\d+)/.exec version
-        match = conditions.unless_os.some (condition) ->
+        match = action.conditions.unless_os.some (condition) ->
           a = !condition.arch.length || condition.arch.some (value) ->
             return true if typeof value is 'string' and value is arch
             return true if value instanceof RegExp and value.test arch

handlers =
  if_os: (action) ->
    final_run = true
    {conditions} = action
    conditions.if_os = [conditions.if_os] unless Array.isArray conditions.if_os
    for condition in conditions.if_os
      # Normalize conditions
      condition.name ?= []
      condition.name = [condition.name] unless Array.isArray condition.name
      condition.version ?= []
      condition.version = [condition.version] unless Array.isArray condition.version
      condition.version = utils.semver.sanitize condition.version, 'x'
      condition.arch ?= []
      condition.arch = [condition.arch] unless Array.isArray condition.arch
    await session null, ({run}) ->
      run
        hooks:

        name = 'redhat' if name.toLowerCase() is 'red hat'
        # Remove patch version (eg centos 7.8)
        version = "#{match[0]}" if match = /^(\d+)\.(\d+)/.exec version
        match = action.conditions.if_os.some (condition) ->
          a = !condition.arch.length || condition.arch.some (value) ->
            return true if typeof value is 'string' and value is arch
            return true if value instanceof RegExp and value.test arch
