Skip to content

False positive error on boolean inputs when there is a logic #235

@peimanja

Description

@peimanja

So I have a reusable workflow and I put couple of inputs as an example here:

on:
  workflow_call:
    inputs:
      image_name:
        description: "Docker image name, such as the app name"
        default: ${{ github.event.repository.name }}
        required: false
        type: string
      push_image:
        description: "Whether or not push the image to the registry.  The default value will evaluate to 'false' on pull requests"
        default: ${{ github.event_name != 'pull_request' }}
        required: false
        type: boolean

I get this error for the push_image input:

input of workflow_call event "push_image" is typed as boolean. its default value must be true or false but got "${{ github.event_name != 'pull_request' }}" [events]

Since ${{ github.event_name != 'pull_request' }} evaluate to a boolean variable, I don't think this is a valid issue that is getting picked up by the linter.

I don't get any error on the image_name variable for string evaluation which is good and I expect the same for boolean

I think the logic is here:

case WorkflowCallEventInputTypeBoolean:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions