Skip to content

Commit f6a4b1c

Browse files
committed
Add stats option
1 parent 68bca56 commit f6a4b1c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This github action installs [`mecha`](https://github.com/mcbeet/mecha) in an iso
2929
| `version` | defaults to `latest` | The version of mecha to install |
3030
| `source` | required | The list of data packs, functions files or folders to validate |
3131
| `minecraft` | defaults to `1.17` | The version of minecraft to use for checking commands |
32+
| `stats` | defaults to `false` | Whether to output statistics |
3233
| `log` | defaults to `WARNING` | The output log level |
3334

3435
## Examples
@@ -66,6 +67,15 @@ Check a data pack at the root of the repository with an explicit minecraft versi
6667
minecraft: "1.18"
6768
```
6869

70+
Check a data pack at the root of the repository and output statistics.
71+
72+
```yml
73+
- uses: mcbeet/check-commands@v1
74+
with:
75+
source: .
76+
stats: "true"
77+
```
78+
6979
## Contributing
7080

7181
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.

action.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: The version of minecraft to use for checking commands
1919
required: true
2020
default: '1.17'
21+
stats:
22+
description: Whether to output statistics
23+
required: true
24+
default: "false"
2125
log:
2226
description: The output log level
2327
required: true
@@ -55,9 +59,10 @@ runs:
5559
env:
5660
MECHA_SOURCE: ${{ inputs.source }}
5761
MECHA_MINECRAFT: ${{ inputs.minecraft }}
62+
MECHA_STATS: ${{ inputs.stats == 'true' && '--stats' || '' }}
5863
MECHA_LOG: ${{ inputs.log }}
5964
run: |
6065
shopt -s extglob
6166
source ~/.mecha_venv/bin/activate
62-
mecha $MECHA_SOURCE --minecraft "$MECHA_MINECRAFT" --log "$MECHA_LOG"
67+
mecha $MECHA_SOURCE --minecraft "$MECHA_MINECRAFT" --log "$MECHA_LOG" $MECHA_STATS
6368
shell: bash

0 commit comments

Comments
 (0)