diff --git a/README.md b/README.md index def3563..eec44f0 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ This github action installs [`mecha`](https://github.com/mcbeet/mecha) in an iso | `version` | defaults to `latest` | The version of mecha to install | | `source` | required | The list of data packs, functions files or folders to validate | | `minecraft` | defaults to `1.17` | The version of minecraft to use for checking commands | +| `stats` | defaults to `false` | Whether to output statistics | | `log` | defaults to `WARNING` | The output log level | ## Examples @@ -66,6 +67,15 @@ Check a data pack at the root of the repository with an explicit minecraft versi minecraft: "1.18" ``` +Check a data pack at the root of the repository and output statistics. + +```yml +- uses: mcbeet/check-commands@v1 + with: + source: . + stats: "true" +``` + ## Contributing Contributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. If you find a bug please try to share a link to the problematic action run. diff --git a/action.yml b/action.yml index 36a6a82..8591244 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,10 @@ inputs: description: The version of minecraft to use for checking commands required: true default: '1.17' + stats: + description: Whether to output statistics + required: true + default: "false" log: description: The output log level required: true @@ -55,9 +59,10 @@ runs: env: MECHA_SOURCE: ${{ inputs.source }} MECHA_MINECRAFT: ${{ inputs.minecraft }} + MECHA_STATS: ${{ inputs.stats == 'true' && '--stats' || '' }} MECHA_LOG: ${{ inputs.log }} run: | shopt -s extglob source ~/.mecha_venv/bin/activate - mecha $MECHA_SOURCE --minecraft "$MECHA_MINECRAFT" --log "$MECHA_LOG" + mecha $MECHA_SOURCE --minecraft "$MECHA_MINECRAFT" --log "$MECHA_LOG" $MECHA_STATS shell: bash