A GitHub Action to automatically format/lint Antlers files.
If you don't need to change anything (config-wise), add this step into your Actions workflow:
- name: Antlers
uses: steadfast-collective/[email protected]
Note: this action won't automatically commit changes to your repository. You'll need to use another action, like
git-auto-commit-action
to handle this.
The antlers-formatter
package which this action uses under the hood, allows for various different parameters. All of which are supported by this Action. You can see them all in use below (obviously not all of them will work at once, this is just as an example):
- name: Antlers
uses: steadfast-collective/[email protected]
with:
file: resources/views/layout.antlers.html
directory: resources/views # this action defaults to resources/views
output: formatted-views
dump: true
options: antlers-config.json
For more information on the available parameters, review the documentation of the antlers-formatter
package.
Just wanna copy this action into your project? Here's the full workflow we use internally at Steadfast Collective:
name: Antlers Toolbox
on:
pull_request:
jobs:
antlers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
- name: Antlers
uses: steadfast-collective/[email protected]
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Antlers Code Style
skip_fetch: true
Under the hood, this action uses the antlers-format
package, part of the Antlers Toolbox by John Koster.
The structure of this action was copied from the laravel-pint-action
.