Skip to content

Commit

Permalink
ci: update stylua (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Aug 9, 2023
1 parent 710c317 commit 66e5a4e
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/stylua.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,48 @@
name: Stylua Formatting
name: Formatting

on: [push, pull_request_target]
on:
push:
branches: [ "main" ]
paths-ignore:
- ".github/**"
- "**.md"
- "**.norg"

jobs:
format-with-stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]

- name: Cache cargo modules
id: cache-cargo
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.cargo
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install cargo
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install stylua
run: cargo install stylua --features lua52

- name: Run formatting
run: stylua -v --verify .

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: autoformat with stylua"
branch: ${{ github.ref }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

0 comments on commit 66e5a4e

Please sign in to comment.