Skip to content

Commit eacdc05

Browse files
committed
Added branch test
1 parent eaff6e1 commit eacdc05

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ on: # rebuild any PRs and main branch changes
33
pull_request:
44
push:
55
branches:
6-
- main
76
- 'releases/*'
7+
- main
8+
- remove_exec_test_002
89

910
jobs:
1011
build: # make sure build/ci work properly
@@ -45,3 +46,22 @@ jobs:
4546
version: latest
4647
token: ${{ secrets.GITHUB_TOKEN }}
4748
args: --check ./test
49+
# only install / cache the StyLua install, don't run it
50+
smoketest_args_false:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Copy Test File
56+
run: |
57+
cp ./test/needs_spaces.lua{,.copy}
58+
59+
- uses: ./
60+
with:
61+
version: latest
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
args: false
64+
65+
- name: Confirm test file was not changed
66+
run: |
67+
cmp ./test/needs_spaces.lua{,.copy}

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ Installs the StyLua binary (from GitHub releases), and caches it. Any StyLua com
1818
args: --check .
1919
```
2020
21+
### Advanced Usage - Skip Running StyLua
22+
This action can be summarized as 2 main steps
23+
24+
1. Get An Installation Of [StyLua](https://github.com/JohnnyMorganz/StyLua)
25+
1a. From the cache
26+
1b. If no cache, install + cache it
27+
2. Run `stylua` with the user-provided `args`
28+
29+
If you would like to keep step 1 but skip step 2 because you want more manual
30+
control, use `args: false`.
31+
32+
```yaml
33+
- uses: actions/checkout@v4
34+
- uses: JohnnyMorganz/stylua-action@v4
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
38+
# CLI arguments
39+
args: false
40+
```
41+
42+
2143
### Parameters
2244

2345
#### `token` (Required)

test/needs_spaces.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local x=1

0 commit comments

Comments
 (0)