Compare commits

..

4 Commits

Author SHA1 Message Date
bab4b3ff8e Skip build and push when flake.lock has no changes
All checks were successful
Check Flake / check-flake (push) Successful in 2m0s
2026-02-22 15:12:45 -08:00
54ab576914 Fix push auth with PAT, correct run link, and add ntfy to check-flake 2026-02-22 15:12:45 -08:00
c84c0716ce Fix push auth with PAT and use correct run_number in ntfy link 2026-02-22 15:12:45 -08:00
a921f40644 Fix git identity and ntfy URL in auto-update workflow 2026-02-22 15:12:45 -08:00
2 changed files with 33 additions and 4 deletions

View File

@@ -20,23 +20,41 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
ref: master ref: master
token: ${{ secrets.PUSH_TOKEN }}
- name: Configure git identity
run: |
git config user.name "gitea-runner"
git config user.email "gitea-runner@neet.dev"
- name: Update flake inputs - 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 - name: Build and cache
if: steps.update.outputs.changed == 'true'
run: bash .gitea/scripts/build-and-cache.sh run: bash .gitea/scripts/build-and-cache.sh
- name: Push updated lockfile - name: Push updated lockfile
if: steps.update.outputs.changed == 'true'
run: git push run: git push
- name: Notify on failure - name: Notify on failure
if: failure() if: failure() && steps.update.outputs.changed == 'true'
run: | run: |
curl -s \ curl -s \
-H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \ -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \
-H "Title: Flake auto-update failed" \ -H "Title: Flake auto-update failed" \
-H "Priority: high" \ -H "Priority: high" \
-H "Tags: warning" \ -H "Tags: warning" \
-d "Auto-update workflow failed. Check: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \ -d "Auto-update workflow failed. Check: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}" \
ntfy.neet.dev/nix-flake-updates https://ntfy.neet.dev/nix-flake-updates

View File

@@ -20,3 +20,14 @@ jobs:
- name: Build and cache - name: Build and cache
run: bash .gitea/scripts/build-and-cache.sh run: bash .gitea/scripts/build-and-cache.sh
- name: Notify on failure
if: failure()
run: |
curl -s \
-H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \
-H "Title: Flake check failed" \
-H "Priority: high" \
-H "Tags: warning" \
-d "Check failed for ${{ gitea.ref_name }}. Check: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}" \
https://ntfy.neet.dev/nix-flake-updates