Skip to content

Fix --level reviewdog option when fail_on_error is false#99

Merged
jdkato merged 1 commit intovale-cli:reviewdogfrom
daniele-pini:fail_on_error_false_level_fix
Sep 25, 2023
Merged

Fix --level reviewdog option when fail_on_error is false#99
jdkato merged 1 commit intovale-cli:reviewdogfrom
daniele-pini:fail_on_error_false_level_fix

Conversation

@daniele-pini
Copy link
Contributor

Description

According to the definition of the core.getInput function, the return type is a string:

/**
 * Gets the value of an input.
 * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
 * Returns an empty string if the value is not defined.
 *
 * @param     name     name of the input to get
 * @param     options  optional. See InputOptions.
 * @returns   string
 */
export function getInput(name: string, options?: InputOptions): string {

The default assigned to the value is also a string:

  fail_on_error:
    description: |
      Exit code for reviewdog when errors are found [true,false]
      Default is `false`.
    required: false
    default: "false"

Except fail_on_error was used like a boolean in code. This PR fixes the comparison to check against the 'true' string value.

@jdkato jdkato merged commit 7542b61 into vale-cli:reviewdog Sep 25, 2023
@daniele-pini daniele-pini deleted the fail_on_error_false_level_fix branch September 25, 2023 13:14
@daniele-pini daniele-pini restored the fail_on_error_false_level_fix branch September 25, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants