diff --git a/.github/workflows/yaml-diff.yaml b/.github/workflows/yaml-diff.yaml index 6119271..747f2cc 100644 --- a/.github/workflows/yaml-diff.yaml +++ b/.github/workflows/yaml-diff.yaml @@ -188,7 +188,7 @@ jobs: section=$(mktemp) { echo - echo "=== ${path} ===" + echo "@@ ${path} @@" cat /tmp/yaml-diff/file-diff } > "${section}" @@ -227,8 +227,15 @@ jobs: echo "Output" echo "" echo - echo '```' - cat /tmp/yaml-diff/body + echo '```diff' + # GitHub colours a `diff` fence by line prefix: `-` red, `+` green, + # `@@ … @@` header. dyff go-patch prefixes changed values with an + # *indented* `-`/`+`; move the marker to column 0 while keeping the + # original indent *after* it, so the highlighter fires and nesting is + # still visible. The rewrite only reorders leading whitespace, so byte + # counts (and the truncation maths above) are unchanged. dyff colour + # stays off (auto-off in CI) — comments cannot render ANSI. + sed -E 's/^([[:space:]]*)([+-])([[:space:]].*)$/\2\1\3/' /tmp/yaml-diff/body echo '```' echo "" echo "" diff --git a/CHANGELOG.md b/CHANGELOG.md index f62d6cc..b389716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), however this project does not use Semantic Versioning and there are no releases. Instead this file uses a date-based structure. +## 2026-07-02 + +### Changed + +- `yaml-diff.yaml` now posts its `dyff` output inside a ` ```diff ` fenced block so GitHub colourises it — removed values render red, added values green, and each file gets a `@@ … @@` header. dyff's go-patch `-`/`+` markers are moved to column 0 (indentation preserved after the marker) so the highlighter picks them up; the rewrite only reorders leading whitespace, so the comment-size truncation limits are unaffected. dyff's own ANSI colour stays disabled (comments can't render it). Requested in giantswarm/roadmap#4121. + ## 2026-06-30 ### Fixed