Add verbose option

This commit is contained in:
Mieszko Grodzicki 2023-01-03 20:49:57 +01:00 committed by Predrag Gruevski
parent a754e4ed0a
commit a708ddccfe
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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