From 6f7e95b9f90250150f83e7fb4d31d485c17a5bdc Mon Sep 17 00:00:00 2001 From: UGA Innovation Factory Date: Fri, 30 Jan 2026 18:26:26 -0500 Subject: [PATCH] fix: Fail the CI if formatting fails --- .gitea/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5a7042b..2ee7501 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -26,18 +26,23 @@ jobs: format-check: name: Format Check runs-on: [self-hosted, nix-builder] + timeout-minutes: 5 steps: - name: Checkout repository uses: actions/checkout@v4 - name: Check formatting + timeout-minutes: 3 run: | - nix fmt **/*.nix - if ! git diff --quiet; then + set -euo pipefail + echo "Checking code formatting..." + output=$(nix fmt **/*.nix 2>&1) + if [ -n "$output" ]; then echo "::error::Code is not formatted. Please run 'nix fmt **/*.nix' locally." - git diff + echo "$output" exit 1 fi + echo "All files are properly formatted" eval-configs: name: Evaluate Key Configurations