name: format project on: workflow_call: workflow_dispatch: permissions: contents: write jobs: cargo-fmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true components: clippy - name: run cargo fmt uses: actions-rs/cargo@v1 with: command: fmt args: --all - uses: EndBug/add-and-commit@v9 with: default_author: github_actions message: "chore: fmt rust files" nix-fmt: runs-on: ubuntu-latest needs: cargo-fmt steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v21 - run: nix fmt - uses: EndBug/add-and-commit@v9 with: default_author: github_actions message: "chore: fmt nix files"