Skip to content

Commit 2286f39

Browse files
committed
Adapt github action to just auto format everything
The previous version just checked if the files were formatted, but this is unnecessary, since I can just make it format everything no matter what so I do not need to deal with formatting manually.
1 parent 0ceeb64 commit 2286f39

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/nix-ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ jobs:
3131
steps:
3232
- name: Checkout repository
3333
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
3436

3537
- name: Set up Nix
3638
uses: cachix/install-nix-action@v22
3739
with:
3840
nix_path: nixpkgs=channel:nixos-unstable
3941

40-
- name: Install nixfmt
41-
run: nix-shell -p nixfmt-rfc-style --command "find . -name '*.nix' -print0 | xargs -0 nixfmt --check"
42+
- name: Install nixfmt and format .nix files
43+
run: nix-shell -p nixfmt-rfc-style --command "find . -name '*.nix' -print0 | xargs -0 nixfmt"
44+
45+
- name: Commit and push formatted files
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
49+
git add .
50+
git diff --cached --quiet || git commit -m "Auto-format Nix files"
51+
git push

users/lukas.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
tree
2222
unzip
2323
usbutils
24+
vimv
2425
wget
2526
yazi
2627
zoxide

0 commit comments

Comments
 (0)