workflows/check-nix-format: Fix reporting of renamed files

When a file was renamed, it would previously report the old path as
being unformatted. This fixes it to report the new one instead.
This commit is contained in:
Silvan Mosberger 2024-07-27 14:08:22 +02:00
parent 5f30950f0b
commit 44f17f8392

View File

@ -76,7 +76,7 @@ jobs:
if [[ -n "$source" ]] && ! nixfmt --check ${{ env.base }}/"$source" 2>/dev/null; then
echo "Ignoring file $file because it's not formatted in the base commit"
elif ! nixfmt --check "$dest"; then
unformattedFiles+=("$file")
unformattedFiles+=("$dest")
fi
done < <(git diff -z --name-status ${{ env.baseRev }} -- '*.nix')