Skip build and push when flake.lock has no changes
All checks were successful
Check Flake / check-flake (push) Successful in 2m0s
All checks were successful
Check Flake / check-flake (push) Successful in 2m0s
This commit is contained in:
@@ -28,16 +28,28 @@ jobs:
|
|||||||
git config user.email "gitea-runner@neet.dev"
|
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 }}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user