Skip to content

Commit

Permalink
Add stats option
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Dec 18, 2021
1 parent 68bca56 commit f6a4b1c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit f6a4b1c

Please sign in to comment.