Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
peimanja opened this issue Oct 14, 2022 · 3 comments
Closed

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

peimanja opened this issue Oct 14, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@peimanja
Copy link

peimanja commented Oct 14, 2022

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:

@peimanja
Copy link
Author

@rhysd any thoughts ?

@rhysd
Copy link
Owner

rhysd commented Oct 29, 2022

This looks a bug of actionlint. actionlint does not consider expressions are used in on.workflow_call.inputs.<name>.default.

@rhysd rhysd added the bug Something isn't working label Oct 29, 2022
@rhysd rhysd closed this as completed in 89b5c30 Oct 29, 2022
@rhysd
Copy link
Owner

rhysd commented Nov 1, 2022

v1.6.22 included this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants