Skip to content

Commit

Permalink
feat: add formatting action (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtraworld authored Aug 26, 2024
1 parent 8995788 commit 156110d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Format
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Install nixfmt-rfc-style
run: nix-env -i nixfmt-rfc-style

- name: Run format command
run: just fmt

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Auto-format Nix files"
file_pattern: "*.nix"

0 comments on commit 156110d

Please sign in to comment.