You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check-upstream-version-task writes LF state file but .editorconfig defaults .json to CRLF #170
Follow-up while adopting the now-multi-key check-upstream-version-task.yml in ptr727/ESPHome-NonRoot (closing the loop on #168 / #169).
Issue
The task writes the state file with printf '%s\n' "$new" > "$STATE_FILE" on the Ubuntu runner, i.e. LF line endings. But the template's .editorconfig (a verbatim downstream carry) sets:
[*.{json,jsonc}]
end_of_line = crlf
So in a downstream that carries .editorconfig, the committed upstream-version.json (LF, to match the task's output and avoid churn) conflicts with the repo's stated CRLF rule for JSON. If anyone opens the file in an .editorconfig-aware editor and saves it, it flips to CRLF, and the next tracker run rewrites it back to LF - a spurious Canonicalize upstream version state file PR.
It's a narrow case (the file is bot-maintained and rarely hand-edited, and .gitattributes* -text stops git from normalizing), but it bites every CRLF-default downstream that adopts the task.
Options
Have the task honor the repo's .editorconfig (e.g. emit CRLF when the state file's configured EOL is CRLF), or
Document that the state file is canonical LF and carve it out - either an .editorconfig stanza ([upstream-version.json] end_of_line = lf) shipped with the task, or a .gitattributesupstream-version.json text eol=lf note in the adoption steps.
Option 2 is probably simplest and keeps the task's output deterministic. Whichever you pick, a line in the task's adoption guidance would save the next downstream from rediscovering it.
Resolved by #172 (squash-merged to develop as 38f46ea). The task now writes the state file as CRLF, honoring .editorconfig's .json rule with no per-file carve-out (option 1). #171 - the LF carve-out approach - was closed as the wrong direction.
Activity
Write upstream-version state file as CRLF to honor the JSON rule (#172)
ptr727 commentedon Jun 21, 2026
Resolved by #172 (squash-merged to
developas 38f46ea). The task now writes the state file as CRLF, honoring.editorconfig's.jsonrule with no per-file carve-out (option 1). #171 - the LF carve-out approach - was closed as the wrong direction.