ci: fix diff check in tidy workflow

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-29 14:49:50 +02:00
parent d7fafb92b7
commit d3e2f30f7b

View File

@ -53,7 +53,7 @@ jobs:
fi
echo "Detected changes after tidy"
echo "untidy=true" | tee -a "$GITHUB_OUTPUT"
diffsum=$(echo "$diff" | sha256sum)
diffsum=$(echo "$diff" | sha256sum | cut -d' ' -f1)
echo "diffsum=${diffsum}" | tee -a "$GITHUB_OUTPUT"
- name: Run Bazel generate
@ -65,8 +65,8 @@ jobs:
shell: bash
run: |
diff=$(git diff)
diffsum=$(echo "$diff" | sha256sum)
if [[ "${{ steps.untidy.outputs.diffsum }}" != "$diffsum" ]]; then
diffsum=$(echo "$diff" | sha256sum| cut -d' ' -f1)
if [[ "${{ steps.untidy.outputs.diffsum }}" == "${diffsum}" ]]; then
echo "Everything is tidy."
echo "ungenerated=false" >> "$GITHUB_OUTPUT"
exit 0