Although still documenting if >1.18 Go marshals maps in reliable order, doing a diff can be done with yq
even though the method changed between v3 and v4.
diff <(yq 'sort_keys(..) | ... comments=""' -P file1.yml) <(yq 'sort_keys(..) | ... comments=""' -P file2.yml)