Skip to content

Commit 03424d2

Browse files
committed
Update input names
1 parent e6a1b9f commit 03424d2

5 files changed

Lines changed: 52 additions & 52 deletions

File tree

.github/workflows/luacheck.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
luacheck
2121
2222
script-only:
23-
name: Test script only
23+
name: Custom script only
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v6
@@ -31,12 +31,12 @@ jobs:
3131
-e GITHUB_WORKSPACE=/workspace \
3232
-e INPUT_PATH=. \
3333
-e INPUT_RUN_LUACHECK=false \
34-
-e INPUT_TEST_SCRIPT=test/validate.lua \
35-
-e INPUT_TEST_ARGS=. \
34+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
35+
-e INPUT_CUSTOM_ARGS=. \
3636
luacheck
3737
3838
both-pass:
39-
name: Luacheck and test script (both pass)
39+
name: Luacheck and custom script (both pass)
4040
runs-on: ubuntu-latest
4141
steps:
4242
- uses: actions/checkout@v6
@@ -48,8 +48,8 @@ jobs:
4848
-e INPUT_FILES=test/sample.lua \
4949
-e INPUT_PATH=. \
5050
-e INPUT_RUN_LUACHECK=true \
51-
-e INPUT_TEST_SCRIPT=test/validate.lua \
52-
-e INPUT_TEST_ARGS=. \
51+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
52+
-e INPUT_CUSTOM_ARGS=. \
5353
luacheck
5454
5555
both-disabled:
@@ -85,7 +85,7 @@ jobs:
8585
[ $? -ne 0 ]
8686
8787
script-fails:
88-
name: Test script fails (expect fail)
88+
name: Custom script fails (expect fail)
8989
runs-on: ubuntu-latest
9090
steps:
9191
- uses: actions/checkout@v6
@@ -97,8 +97,8 @@ jobs:
9797
-e GITHUB_WORKSPACE=/workspace \
9898
-e INPUT_PATH=. \
9999
-e INPUT_RUN_LUACHECK=false \
100-
-e INPUT_TEST_SCRIPT=test/validate.lua \
101-
-e INPUT_TEST_ARGS=--fail \
100+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
101+
-e INPUT_CUSTOM_ARGS=--fail \
102102
luacheck
103103
[ $? -ne 0 ]
104104
@@ -117,8 +117,8 @@ jobs:
117117
-e INPUT_PATH=. \
118118
-e INPUT_RUN_LUACHECK=true \
119119
-e INPUT_FAIL_FAST=true \
120-
-e INPUT_TEST_SCRIPT=test/validate.lua \
121-
-e INPUT_TEST_ARGS=. \
120+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
121+
-e INPUT_CUSTOM_ARGS=. \
122122
luacheck
123123
[ $? -ne 0 ]
124124
@@ -137,8 +137,8 @@ jobs:
137137
-e INPUT_PATH=. \
138138
-e INPUT_RUN_LUACHECK=true \
139139
-e INPUT_FAIL_FAST=true \
140-
-e INPUT_TEST_SCRIPT=test/validate.lua \
141-
-e INPUT_TEST_ARGS=--fail \
140+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
141+
-e INPUT_CUSTOM_ARGS=--fail \
142142
luacheck
143143
[ $? -ne 0 ]
144144
@@ -157,8 +157,8 @@ jobs:
157157
-e INPUT_PATH=. \
158158
-e INPUT_RUN_LUACHECK=true \
159159
-e INPUT_FAIL_FAST=false \
160-
-e INPUT_TEST_SCRIPT=test/validate.lua \
161-
-e INPUT_TEST_ARGS=. \
160+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
161+
-e INPUT_CUSTOM_ARGS=. \
162162
luacheck
163163
[ $? -ne 0 ]
164164
@@ -177,8 +177,8 @@ jobs:
177177
-e INPUT_PATH=. \
178178
-e INPUT_RUN_LUACHECK=true \
179179
-e INPUT_FAIL_FAST=false \
180-
-e INPUT_TEST_SCRIPT=test/validate.lua \
181-
-e INPUT_TEST_ARGS=--fail \
180+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
181+
-e INPUT_CUSTOM_ARGS=--fail \
182182
luacheck
183183
[ $? -ne 0 ]
184184
@@ -214,7 +214,7 @@ jobs:
214214
luacheck
215215
216216
script-from-url:
217-
name: Test script from URL
217+
name: Custom script from URL
218218
runs-on: ubuntu-latest
219219
steps:
220220
- uses: actions/checkout@v6
@@ -225,12 +225,12 @@ jobs:
225225
-e GITHUB_WORKSPACE=/workspace \
226226
-e INPUT_PATH=. \
227227
-e INPUT_RUN_LUACHECK=false \
228-
-e INPUT_TEST_SCRIPT="https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/test/validate.lua" \
229-
-e INPUT_TEST_ARGS=. \
228+
-e INPUT_CUSTOM_SCRIPT="https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/test/validate.lua" \
229+
-e INPUT_CUSTOM_ARGS=. \
230230
luacheck
231231
232232
script-args:
233-
name: Test script with multiple args
233+
name: Custom script with multiple args
234234
runs-on: ubuntu-latest
235235
steps:
236236
- uses: actions/checkout@v6
@@ -241,8 +241,8 @@ jobs:
241241
-e GITHUB_WORKSPACE=/workspace \
242242
-e INPUT_PATH=. \
243243
-e INPUT_RUN_LUACHECK=false \
244-
-e INPUT_TEST_SCRIPT=test/validate.lua \
245-
-e 'INPUT_TEST_ARGS=--echo foo bar' \
244+
-e INPUT_CUSTOM_SCRIPT=test/validate.lua \
245+
-e 'INPUT_CUSTOM_ARGS=--echo foo bar' \
246246
luacheck
247247
248248
script-writes-repo:
@@ -257,7 +257,7 @@ jobs:
257257
-e GITHUB_WORKSPACE=/workspace \
258258
-e INPUT_PATH=. \
259259
-e INPUT_RUN_LUACHECK=false \
260-
-e INPUT_TEST_SCRIPT=test/write.lua \
260+
-e INPUT_CUSTOM_SCRIPT=test/write.lua \
261261
luacheck
262262
- name: Verify script wrote file
263263
run: test -f test/.written-by-script

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# luacheck
22

3-
A luacheck GitHub Action that runs in Docker. **No setup, instant run**luacheck is pre-installed (Alpine + apk), so jobs start immediately. Self-contained, no external image dependencies.
3+
A luacheck GitHub Action that runs in Docker with a Lua entry point for custom scripts. luacheck and Lua 5.1 are pre-installed (Alpine + apk), so jobs start immediately.
44

55
## Usage
66

@@ -28,7 +28,7 @@ jobs:
2828
annotate: warning # or "error" — emits GitHub annotations on PRs
2929
```
3030
31-
See this repo's [Luacheck workflow](.github/workflows/luacheck.yml) for usage examples (luacheck-only, test-script-only, and both).
31+
See this repo's [Luacheck workflow](.github/workflows/luacheck.yml) for usage examples (luacheck-only, custom-script-only, and both).
3232
3333
### Luacheck + script that modifies repo
3434
@@ -37,8 +37,8 @@ See this repo's [Luacheck workflow](.github/workflows/luacheck.yml) for usage ex
3737
with:
3838
args: -q
3939
config: https://raw.githubusercontent.com/your-org/config/main/.luacheckrc
40-
test_script: scripts/generate_options.lua
41-
test_args: module1.toc module2.toc
40+
custom_script: scripts/generate_options.lua
41+
custom_args: module1.toc module2.toc
4242
fail_fast: false # run both even if luacheck fails
4343
```
4444
@@ -51,10 +51,10 @@ See this repo's [Luacheck workflow](.github/workflows/luacheck.yml) for usage ex
5151
| `args` | `""` | Extra luacheck CLI arguments (see below) |
5252
| `config` | `""` | URL to custom `.luacheckrc` |
5353
| `annotate` | `none` | `none`, `warning`, or `error` — show issues as PR annotations (incompatible with `-qq`/`-qqq`) |
54-
| `test_script` | `""` | URL or path (relative to `path`, or absolute) to a Lua script to run after luacheck. Runs in the working directory and can modify repo files (e.g., code generation scripts). |
55-
| `test_args` | `"."` | Arguments passed to the test script |
54+
| `custom_script` | `""` | URL or path (relative to `path`, or absolute) to a Lua script to run after luacheck. Runs in the working directory and can modify repo files (e.g., code generation scripts). |
55+
| `custom_args` | `"."` | Arguments passed to the custom script |
5656
| `run_luacheck` | `true` | When false, skip luacheck (script-only mode) |
57-
| `fail_fast` | `false` | When true, exit on first failure. When false, run both luacheck and script, then exit with failure if any failed. |
57+
| `fail_fast` | `false` | When true, exit on first failure. When false, run both luacheck and the custom script, then exit with failure if any failed. |
5858

5959
### Common `args` options
6060

action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: luacheck
2-
description: Runs luacheck in a pre-built Docker container. Optionally runs a Lua test script (from URL or path) before or instead of luacheck.
2+
description: Runs luacheck in a pre-built Docker container. Optionally runs a custom Lua script (from URL or path) before or instead of luacheck.
33
branding:
44
icon: check-square
55
color: yellow
@@ -31,14 +31,14 @@ inputs:
3131
Requires warnings not be suppressed (avoid -qq or -qqq with args).
3232
required: false
3333
default: none
34-
test_script:
34+
custom_script:
3535
description: >
3636
URL or path (relative to path, or absolute) to a Lua script to run after luacheck.
3737
required: false
3838
default: ''
39-
test_args:
39+
custom_args:
4040
description: >
41-
Arguments passed to the test script.
41+
Arguments passed to the custom script.
4242
required: false
4343
default: '.'
4444
run_luacheck:
@@ -67,8 +67,8 @@ runs:
6767
-e INPUT_ARGS="${{ inputs.args }}" \
6868
-e INPUT_CONFIG="${{ inputs.config }}" \
6969
-e INPUT_ANNOTATE="${{ inputs.annotate }}" \
70-
-e INPUT_TEST_SCRIPT="${{ inputs.test_script }}" \
71-
-e INPUT_TEST_ARGS="${{ inputs.test_args }}" \
70+
-e INPUT_CUSTOM_SCRIPT="${{ inputs.custom_script }}" \
71+
-e INPUT_CUSTOM_ARGS="${{ inputs.custom_args }}" \
7272
-e INPUT_RUN_LUACHECK="${{ inputs.run_luacheck }}" \
7373
-e INPUT_FAIL_FAST="${{ inputs.fail_fast }}" \
7474
-e GITHUB_WORKSPACE=/workspace \

entrypoint.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ fi
1010
ARGS="${INPUT_ARGS:-}"
1111
CONFIG_URL="${INPUT_CONFIG:-}"
1212
ANNOTATE="${INPUT_ANNOTATE:-none}"
13-
TEST_SCRIPT="${INPUT_TEST_SCRIPT:-}"
14-
TEST_ARGS="${INPUT_TEST_ARGS:-.}"
13+
CUSTOM_SCRIPT="${INPUT_CUSTOM_SCRIPT:-}"
14+
CUSTOM_ARGS="${INPUT_CUSTOM_ARGS:-.}"
1515
RUN_LUACHECK="${INPUT_RUN_LUACHECK:-true}"
1616
FAIL_FAST="${INPUT_FAIL_FAST:-false}"
1717

@@ -76,35 +76,35 @@ if [ "$RUN_LUACHECK" = "true" ]; then
7676
fi
7777
fi
7878

79-
# Run test script when provided (URL or path)
79+
# Run custom script when provided (URL or path)
8080
script_exit=0
81-
if [ -n "$TEST_SCRIPT" ]; then
81+
if [ -n "$CUSTOM_SCRIPT" ]; then
8282
script_path=""
83-
case "$TEST_SCRIPT" in
83+
case "$CUSTOM_SCRIPT" in
8484
http://*|https://*)
8585
script_path="/tmp/script.lua"
86-
if ! curl -fsSL "$TEST_SCRIPT" -o "$script_path"; then
87-
echo "::error::Unable to download script from \"$TEST_SCRIPT\"" >&2
86+
if ! curl -fsSL "$CUSTOM_SCRIPT" -o "$script_path"; then
87+
echo "::error::Unable to download script from \"$CUSTOM_SCRIPT\"" >&2
8888
exit 1
8989
fi
9090
;;
9191
*)
92-
if [ -f "$TEST_SCRIPT" ]; then
93-
script_path="$TEST_SCRIPT"
94-
elif [ -f "$WORK_DIR/$TEST_SCRIPT" ]; then
95-
script_path="$WORK_DIR/$TEST_SCRIPT"
92+
if [ -f "$CUSTOM_SCRIPT" ]; then
93+
script_path="$CUSTOM_SCRIPT"
94+
elif [ -f "$WORK_DIR/$CUSTOM_SCRIPT" ]; then
95+
script_path="$WORK_DIR/$CUSTOM_SCRIPT"
9696
else
97-
echo "::error::Test script not found: \"$TEST_SCRIPT\"" >&2
97+
echo "::error::Custom script not found: \"$CUSTOM_SCRIPT\"" >&2
9898
exit 1
9999
fi
100100
;;
101101
esac
102102
set +e
103-
lua5.1 "$script_path" $TEST_ARGS
103+
lua5.1 "$script_path" $CUSTOM_ARGS
104104
script_exit=$?
105105
set -e
106106
if [ $script_exit -ne 0 ]; then
107-
echo "::error::$TEST_SCRIPT failed with exit code $script_exit" >&2
107+
echo "::error::$CUSTOM_SCRIPT failed with exit code $script_exit" >&2
108108
if [ "$FAIL_FAST" = "true" ]; then
109109
exit $script_exit
110110
fi

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Fixtures used by the [Luacheck workflow](../.github/workflows/luacheck.yml). Eac
3535
- **config-url** — Config from raw GitHub URL
3636
- **args-quiet** — Luacheck `-q`
3737
- **script-from-url** — Script from raw GitHub URL
38-
- **script-args** — Multiple `test_args` (`--echo foo bar`)
38+
- **script-args** — Multiple `custom_args` (`--echo foo bar`)
3939
- **script-writes-repo** — Script writes file, verify with `test -f`
4040
- **path-subdir**`path: test`
4141
- **files-specific**`files: test/sample.lua`

0 commit comments

Comments
 (0)