Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Extra clarification of boolean vs "boolean" inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Jan 10, 2023
1 parent dfd5a5a commit d3609b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,20 @@ jobs:
| Name | Description | Type | Default |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------- |
| `ghc-version` | GHC version to use, ex. `9.2` or `9.2.4`. | string | `latest` |
| `cabal-version` | Cabal version to use, ex. `3.4`. | string | `latest` |
| `stack-version` | Stack version to use, ex. `latest`. Stack will only be installed if `enable-stack` is set. | string | `latest` |
| `ghc-version` | GHC version to use, e.g. `9.2` or `9.2.4`. | `string` | `latest` |
| `cabal-version` | Cabal version to use, e.g. `3.4`. | `string` | `latest` |
| `stack-version` | Stack version to use, e.g. `latest`. Stack will only be installed if `enable-stack` is set. | `string` | `latest` |
| `enable-stack` | If set, will setup Stack. | "boolean" | false/unset |
| `stack-no-global` | If set, `enable-stack` must be set. Prevents installing GHC and Cabal globally. | "boolean" | false/unset |
| `stack-setup-ghc` | If set, `enable-stack` must be set. Runs stack setup to install the specified GHC. (Note: setting this does _not_ imply `stack-no-global`.) | "boolean" | false/unset |
| `disable-matcher` | If set, disables match messages from GHC as GitHub CI annotations. | "boolean" | false/unset |
| `cabal-update` | If set to `false`, skip `cabal update` step. | boolean | `true` |
| `cabal-update` | If set to `false`, skip `cabal update` step. | `boolean` | `true` |

Note: "boolean" types are set/unset, not true/false.
That is, setting any "boolean" to a value other than the empty string (`""`) will be considered true/set.
However, to avoid confusion and for forward compatibility, it is still recommended to **only use value `true` to set a "boolean" flag.**

In contrast, a proper `boolean` field only accepts values `true` and `false`.
In contrast, a proper `boolean` input like `cabal-update` only accepts values `true` and `false`.

## Outputs

Expand Down
5 changes: 4 additions & 1 deletion setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ inputs:
cabal-update:
required: false
default: true
description: 'Set to false to prevent `cabal update` from being run.'
description: 'Set to `false` to prevent `cabal update` from being run.'
# Note: 'cabal-update' only accepts 'true' and 'false' as values.
# This is different from the other flags ('enable-stack', 'disable-matcher' etc.)
# which are true as soon as they are not null.
disable-matcher:
required: false
description: 'If specified, disables match messages from GHC as GitHub CI annotations.'
Expand Down

0 comments on commit d3609b3

Please sign in to comment.