Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JohnnyMorganz/stylua-action
GitHub action for StyLua
https://github.com/JohnnyMorganz/stylua-action
formatter github-action lua printer stylua
Last synced: 6 days ago
JSON representation
GitHub action for StyLua
- Host: GitHub
- URL: https://github.com/JohnnyMorganz/stylua-action
- Owner: JohnnyMorganz
- License: mit
- Created: 2021-05-11T19:14:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-10T10:20:18.000Z (9 months ago)
- Last Synced: 2024-11-04T15:03:04.049Z (9 days ago)
- Topics: formatter, github-action, lua, printer, stylua
- Language: TypeScript
- Homepage:
- Size: 363 KB
- Stars: 53
- Watchers: 6
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GitHub Action to run [StyLua](https://github.com/JohnnyMorganz/StyLua), a Lua code formatter.
Installs the StyLua binary (from GitHub releases), and caches it. Any StyLua command can then be run.
> **NOTE:** We recommend using a toolchain manager such as [aftman](https://github.com/LPGhatguy/aftman) to manage StyLua, as it allows you to define the version used throughout your project - both on the command line, and in GitHub actions.
## Usage
```yaml
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
# CLI arguments
args: --check .
```### Parameters
#### `token` (Required)
GitHub token. Required since the binary is downloaded from GitHub releases (to speed download)
#### `args` (Required)
The arguments to pass to the StyLua binary
#### `version` (Required)
The version of StyLua to use. Follows semver syntax.
Alternatively, supply `latest` to use the latest available release.**NOTE: using `latest` may cause the action to fail if StyLua updates and the formatting changes!**
Based off https://github.com/Roblox/setup-foreman, licensed under [MIT](https://github.com/Roblox/setup-foreman/blob/master/LICENSE.txt)