From bab4b3ff8e6eb27bcee727b84ed2d64dc85a8e88 Mon Sep 17 00:00:00 2001 From: Zuckerberg Date: Sun, 22 Feb 2026 15:12:29 -0800 Subject: [PATCH] Skip build and push when flake.lock has no changes --- .gitea/workflows/auto-update.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/auto-update.yaml b/.gitea/workflows/auto-update.yaml index d2b6f35..413b95f 100644 --- a/.gitea/workflows/auto-update.yaml +++ b/.gitea/workflows/auto-update.yaml @@ -28,16 +28,28 @@ jobs: git config user.email "gitea-runner@neet.dev" - name: Update flake inputs - run: nix flake update --commit-lock-file + id: update + run: | + nix flake update + if git diff --quiet flake.lock; then + echo "No changes to flake.lock, nothing to do" + echo "changed=false" >> "$GITHUB_OUTPUT" + else + git add flake.lock + git commit -m "flake.lock: update inputs" + echo "changed=true" >> "$GITHUB_OUTPUT" + fi - name: Build and cache + if: steps.update.outputs.changed == 'true' run: bash .gitea/scripts/build-and-cache.sh - name: Push updated lockfile + if: steps.update.outputs.changed == 'true' run: git push - name: Notify on failure - if: failure() + if: failure() && steps.update.outputs.changed == 'true' run: | curl -s \ -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \