diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 3b65914..01cadf3 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -27,12 +27,13 @@ jobs: expected_file=./test-data/analysis-output.yaml actual_file=./output/output.yaml function filter_and_sort() { - yq e 'del(.[].skipped) | del(.[].unmatched)' $1 > /tmp/filtered - yq e '.[]?.violations |= (. | to_entries | sort_by(.key) | from_entries)' /tmp/filtered > /tmp/sorted - yq e '.[]?.violations[]?.incidents |= sort_by(.uri)' /tmp/sorted > $1 + yq e 'del(.[].skipped) | del(.[].unmatched)' $1 \ + | yq e '.[]?.violations |= (. | to_entries | sort_by(.key) | from_entries)' \ + | yq e '.[]?.violations[]?.incidents |= sort_by(.uri)' \ + | yq e '.[] | (.tags // []) |= sort' } - filter_and_sort $expected_file - filter_and_sort $actual_file + filter_and_sort $expected_file > $expected_file + filter_and_sort $actual_file > $actual_file diff $expected_file $actual_file - name: Fail if dependencies output does not match expected