runs nixfmt
This commit is contained in:
29
.github/workflows/nixfmt.yml
vendored
Normal file
29
.github/workflows/nixfmt.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Nix Format Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v25
|
||||
|
||||
- name: Install nixfmt
|
||||
run: nix-env -i nixfmt
|
||||
|
||||
- name: Check Nix formatting
|
||||
run: |
|
||||
find . -name "*.nix" -type f -exec nixfmt {} \;
|
||||
if git diff --quiet; then
|
||||
echo "All Nix files are properly formatted"
|
||||
else
|
||||
echo "Error: Some Nix files are not properly formatted"
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user