diff --git a/README.md b/README.md index 41f56fa..2eb2c8d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Every argument is optional. |--------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------| | crate-name | The crate whose API to check for semver. If not set, all crates in the workspace are processed. | | | manifest-path | Path to Cargo.toml of crate or workspace to check. Has an effect only if `crate-name` is not specified. | | +| verbose | Enables verbose output of `cargo-semver-checks`. | `false` | # Scenarios diff --git a/action.yml b/action.yml index 1b1d877..68c0a69 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,11 @@ inputs: description: 'Path to Cargo.toml of crate or workspace to check. Has an effect only if crate-name is not specified.' required: false default: '' + verbose: + description: 'Enables verbose output of `cargo-semver-checks`.' + type: boolean + required: true + default: false runs: using: "composite" steps: @@ -31,7 +36,13 @@ runs: export CRATE_NAME="${{ inputs.crate-name }}" export MANIFEST_PATH="${{ inputs.manifest-path }}" - export SEMVER_CHECKS_OPTIONS="${CRATE_NAME:+"--package $CRATE_NAME"} ${MANIFEST_PATH:+"--manifest-path $MANIFEST_PATH"}" + if [[ ${{ inputs.verbose }} == 'true' ]]; then + export VERBOSE_FLAG="--verbose" + else + export VERBOSE_FLAG="" + fi + + export SEMVER_CHECKS_OPTIONS="${CRATE_NAME:+"--package $CRATE_NAME"} ${MANIFEST_PATH:+"--manifest-path $MANIFEST_PATH"} $VERBOSE_FLAG" # Check for semver violations. cargo install cargo-semver-checks --locked